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
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,581 questions
{count} votes

Accepted answer
  1. Naomi 7,361 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