Return ColumnNames from Select query in SQL Server? -
first written select query join retrieving required columns. after using top 0 got required columns. come this,
i dont want records. need result of column names this,
sample code:
select top 0 *tablename*.* *tablename* (some joins , conditions)
tablename => contains dynamic columns (after doing joins)
inspired on @tony hopkinson suggestion
select c.name sys.tables t inner join sys.columns c on c.object_id = t.object_id t.name = @table
Comments
Post a Comment