>>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
This is relevant to this discussion and to Victor's as well
http://forum.lessthandot.com/viewtopic.php?f=17&t=6187
If it's not broken, fix it until it is.
My Blog