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.
| Author |
Topic |
|
cosmo
Starting Member
2 Posts |
Posted - 2004-01-15 : 23:42:16
|
| Is there a way to set a variable to the result of a dynamic sql statement?Example:DECLARE@aSQL NVARCHAR(250),@aCount INTSELECT @aSQL = 'SELECT COUNT(*) FROM [System]'--EXEC sp_ExecuteSQL @aSQLSELECT @aCount = EXEC sp_ExecuteSQL @aSQLThanks for your time! |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-01-16 : 01:13:12
|
| seehttp://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. |
 |
|
|
cosmo
Starting Member
2 Posts |
Posted - 2004-01-19 : 16:34:29
|
| Thanks nr! |
 |
|
|
|
|
|