Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dynamic SQL Question

Author  Topic 

swhedges
Starting Member

3 Posts

Posted - 2001-07-11 : 14:30:00
Hmmm ... I'm trying to set a variable equal to an EXEC d-SQL statement

SET @y = EXEC('SELECT' + '[' + 'SN' + ' ' + @x + ']' + 'FROM str WHERE [login id] =' + @login)

I know I can't do it this way, how can it be done?

   

- Advertisement -