Skip to content

Instantly share code, notes, and snippets.

@scottlaw1
Created July 11, 2012 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottlaw1/3089921 to your computer and use it in GitHub Desktop.
Save scottlaw1/3089921 to your computer and use it in GitHub Desktop.
Inserting stored procedure results into a table variable
CREATE PROC test_proc
AS
SET NOCOUNT ON
SELECT TOP 10 id, name FROM employee
declare @sometable as table([id] int, name varchar(64))
INSERT INTO @sometable
exec test_proc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment