-3

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

  • 1
    You 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 Answers1

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