I have the following table variable declaration:
DECLARE @MyTable TABLE (
and I want to declare another table variable with the same structure (so that I paste-from-select into the first, and then copy the result to the second, and then delete the records from the first variable one by one and return the second - as a result).
I tried this:
DECLARE @MyTable, @MyTableCopy TABLE ( --ten columns declared here )
but SQL Server Express is not satisfied and says
Msg 102, Level 15, State 1, Line 1 Invalid syntax next to ','.
How to declare two identically structured table variables?
source share