As the code is not posted, I am guessing you are doing something like:
INSERT INTO @yourTableVar Execute yourSP
Please note the following things about the table variables
- You can not use the table variable to get the output of stored procedure.
- You can not use SELECT INTO with table variables.
- you can not use table variable in: INSERT INTO @tableVar SELECT * FROM anyTable.
and lot more...
-Vikas Bindra