Insert Into Table with Exec Sproc

Pat Snow 111 Reputation points
2023-05-02T23:55:26.7+00:00

How do you insert data into a table variable or temp table by calling a stored procedure?

Azure SQL Database
SQL Server Other
{count} votes

Accepted answer
  1. Naomi Nosonovsky 8,431 Reputation points
    2023-05-03T00:18:33.2933333+00:00

    This should work fine:

    insert @Address exec [dbo].[GetAddress] @City = 'Atlanta',@StateProvinceID = 80  SELECT * FROM @Address
    
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.