Hi, I have an issue when running multiple SQL statements through IDEA:
DECLARE @x int
SELECT * FROM MyTable WHERE id = @x
go
DECLARE @y varchar(max)
SELECT * FROM MyTable WHERE name = @y
go
...in this situation, the console spits out an error - @x is not declared. But if i run the scripts (between the go's) one by one it works fine.
How can I get this to work for the whole script?
~gilbert