SQL Server Transact Basic to Expert - Insert Query with data from Storedprocedure
This blog shows how to use insert query with stored procedure result. Using the result set of stored procedure the insert query inserts the data to the table
Syntax:
INSERT into table
( Column_list )
Exec Storedprocedurename
Example:
Insert into emptable
(Empname, Empid)
Exec usp_getempdetails
Note: stored procedure should return the same columns