- ….. using the QUOTENAME function. To get a copy paste list, enter the table name in both places and then run as query to text in SQL Query Analyzer.
SELECT ‘,[dbo].[your_table_name].’ + quotename(name, ‘]’)
FROM dbo.syscolumns WITH (NOLOCK)
WHERE id = object_id(‘your_table_name’)
ORDER BY colid

You must log in to post a comment.