sql - How to get only column names as the following sample? -
currently, have string of column names below (this string computed in stored pro, , column name got several tables):
@str = 'select fieldname1, fieldname2, fieldname3' in stored, how can return datatable no data , @str list of column name? tried query that:
exec (@str) but requires table it. don't want put table because query data, , take long time finish.
put 'null' in front of each column name, in:
select null fieldname1, null fieldname2, null fieldname3
Comments
Post a Comment