I need to create a temp table with dynamic row names, and then get the row names in a list of strings, which I use later in my procedure
Asked
Active
Viewed 42 times
-3
-
1You said row names, instead of column names, is this temp table supposed to be pivoted? – S3S Jun 28 '16 at 15:48
-
http://stackoverflow.com/questions/756080/how-to-retrieve-field-names-from-temporary-table-sql-server-2008 – Sam Jun 28 '16 at 15:55
1 Answers
1
I'm assuming you have already created your dynamic temp
To get the fields in a temp
select * from tempdb.sys.columns where object_id = object_id('tempdb..#Temp');

John Cappelletti
- 79,615
- 7
- 44
- 66