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
 Transact-SQL (2000)
 dynamic query returning a value

Author  Topic 

lordkyl
Starting Member

2 Posts

Posted - 2003-12-17 : 11:20:37
Is there any way to return a value from a dynamic query?

Like, select @var = myfield from tablesomething

But using a dynamic query...

nr
SQLTeam MVY

12543 Posts

Posted - 2003-12-17 : 11:25:20
see sp_executesql or
http://www.nigelrivett.net/sp_executeSQL.html



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

lordkyl
Starting Member

2 Posts

Posted - 2003-12-17 : 11:49:30
Thanks! That worked perfectly.
Go to Top of Page
   

- Advertisement -