arulmanicse
SSC Veteran
Points: 207
More actions
April 2, 2009 at 4:23 am
#219686
can any one tell me about how to write the code for the above case
Ramesh Saive
SSC-Insane
Points: 24275
April 2, 2009 at 4:54 am
#970531
DECLARE @Column VARCHAR(100),
@sql NVARCHAR(MAX)
SELECT @Column = 'name',
@sql = 'SELECT [' + @Column + '] FROM sys.tables'
EXECUTE( @sql )
EXECUTE sp_executesql @sql
--Ramesh
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply