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

Answer accepted by question author
  1. Naomi Nosonovsky 8,881 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.