SMO Temp Tables

  • Hi All,

    I created an application (VB.NET) using SMO. This application acts like SQL Server Analyzer.

    My problem is that I'm trying to use temp table but I'm having no joy.

    When I execute the following:

    select * into #Temp from tblPrinters

    select * from #Temp

    My data is displayed. However, if I then execute

    select * from #Temp

    I get an error that the object does not exists. How do I continue to have access to the temp table until I drop it.

    Thanks

    Alex

  • temp tables are designed to be removed automatically when they fall out of scope.

    I suggest you create a non temp table, if you wish to delete it when you are finished.

    Converting oxygen into carbon dioxide, since 1955.
  • But how do I keep in in scope? With DMO, this was not an issue, it worked just like the SQL QA. There mus be a way to keep my temp table until I drop it.

  • Alexander-623609 (2/22/2010)


    But how do I keep in in scope? With DMO, this was not an issue, it worked just like the SQL QA. There mus be a way to keep my temp table until I drop it.

    Show us your VB.net/SMO code, please.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

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

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