How do I insert the results of the stored procedure into the table using SQL Server?”

 Posted by Bandi on 9/30/2013 | Category: Sql Server Interview questions | Views: 3053 | Points: 40

By using INSERT...EXEC statement we can insert result set of stored procedure into a table
For example, If TableName: EMP which has columns id, anme, salary (nullable), departmentID (nullable) and procedure returns only id and name as output then

INSERT INTO TableName( id, name)
EXEC ProcedureName

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response