I simply want to declare a variable and use it later.
declare @iMyVar int
select * from Tbl1 where Col1 = @iMyVar
I keep getting a syntax error:
SQL0104N An unexpected token "@iMyVar" was found following "Declare ". Expected tokens may include: "JOIN <joined_table>". SQLSTATE=42601