I think you need an XML data type for this. I will give an example here. ##
Now create a stored procedure that returns two sets of results.
CREATE PROCEDURE GetEmployeeInfo AS SET NOCOUNT ON SELECT EmployeeName, DepartmentID FROM Employees WHERE EmployeeID = 1 SELECT DepartmentName FROM Departments WHERE DepartmentID = 1 GO
Create the following stored procedure that takes an XML parameter. This procedure will insert the data from the XML parameter into the Employee table.
CREATE PROCEDURE ProcessXml ( @data XML ) AS INSERT INTO Employees(EmployeeName, DepartmentID) SELECT xdvalue('EmployeeName[1]','VARCHAR(50)') AS EmployeeName, xdvalue('DepartmentID[1]','INT') AS DepartmentID FROM @data.nodes('/NewDataSet/Table') x(d) GO
source share