all groups > sql server programming > december 2006 >
You're in the

sql server programming

group:

Execute Variable



Execute Variable TBoon
12/4/2006 10:21:00 PM
sql server programming: declare @vA varchar (50)
set @vA = 'select count(*) from Table1'


Re: Execute Variable Kalen Delaney
12/4/2006 10:27:07 PM
EXECUTE (@vA)

Note the variable has a scope of single batch, so you have to use the
EXECUTE in the same batch as the DECLARE and SET.

--
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com


[quoted text, click to view]

AddThis Social Bookmark Button