When there is a requirement to declare several local variables inside TSQL script, it appears that table variables must have it's own DECLARE clause. Surprisingly, Books Online do not mention that.Here you go :DECLARE @str1 varchar(8),…
Declaring table variable in SQL Server 2005
D