Hi Usman,
Try this...
Declare @ABC VARCHAR(10)
set @ABC = 'Oye'
EXEC ('SELECT' + ' '' UPDATE ' + @ABC + '''')
-----Original Message-----
From: Usman Farhat [mailto:Usman.[Email Address Removed] Wednesday, October 23, 2002 10:12 AM
To: LazyDBA.com Discussion
Subject: Dynamic String !
Hi Guys !
If some one can help me in this situation , i could not manage it from last nigh ... i will be very thankful to you people ....
This is a sample of my problem which actually relates to a bigger query stuff ... but actual problem stuff is this ...
EXEC ('SELECT' + ' '' UPDATE TABLE '' ' )
For Example This particular Code Line Returns Me Result :
---------------
UPDATE TABLE
ITS OK .. But i got a situation Where I wana Select Result Like This
----------------------
UPDATE TABLE TableName
WHILE TableName I wana Get Through Some Variable AS Dynamic Selection
Some Stuff like this i need in Correct Format !
Declare @ABC VARCHAR(10)
set @ABC = 'Oye'
EXEC ('SELECT' + ' '' UPDATE '' ' + '@ABC' ) -- Does Not Work
I hope your people experience will help me out of this problem ... Thanks In Advance ...
Usman Farhat
---------------------------------------------------------------------
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page