.NET Temporary Tables

  • I have a .NET process that constructs a report, with optional columns from variable parameters. The process first creates a temporary table with nulls for all the optional columns, then a second call populates the optional columns from the parameters supplied.

    Now our DBAs in their wisdom(?) have denied CREATE TABLE in tempdb. I can use #Tmp tables. Obviously the #Tmp table would not be there for the second call.

    Is there a way to persist a temporary table in .NET between calls?

  • Why can't you do all of the processing in 1 batch (create, populate, select, drop)?

  • You mean chain all the dynamic SQL into one ';' separated string and do a single call?

    I'll give it a try.

  • Exactly... simple way to solve the problem!

  • Works fine, and all I had to do is reorder a few lines in the C#. 😀 Many thanks.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply