I have a stored procedure with many parameters.
I want to insert (or maybe select) like this:
INSERT INTO @TEMP_TABLE
EXECUTE STORED_PROCEDURE
without defining the schema of @TEMP_TABLE.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot do this with a
@tablevariable.The work around in the link posted by Joe uses
SELECT ... INTO.This is not currently supported by table variables (and won’t ever be from the response to this connect item) as the schema for table variables needs to be known at compile time.