Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select @var = EXEC(@stmt)
Message
 
 
To
08/06/2009 15:16:54
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01404537
Message ID:
01404541
Views:
55
This message has been marked as the solution to the initial question of the thread.
>Please tell me what is wrong with this. I was sure that I used this syntax before. What would be a better way to do this??
>
>
>		SET @SQLCmd = 'SELECT TOP 1 [name] FROM ' + QUOTENAME(@DBName) + 
>		'.sys.all_objects where object_id = '+ CAST (@objectID AS VARCHAR(15))
>		SET @TblName = EXEC (@SQLCmd)
>
>
>Your help is appreciated.

See also FAQ #8130
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform