how to get all column from table than set comma seperate in sql

select string_agg(name,',') name from  sys.columns where object_id = object_id('dbo.tablename')

output :

col1,col2,col3

Post a Comment

0 Comments