Can Temporary Tables be used in DTS Packages?

  • We have SQL Server 2000 (SP3). My questions are: Can temporary tables (local or global) be used within DTS Packages as part of SQL Code within an Execute SQL Task? As part of a Stored Procedure within an Execute SQL Task? Aa part of an ActiveX Script Task (VBScript)?

    Thanks in advance, Kevin

     

  • Yes, you can use temporary tables in DTS packages - I have several packages that use them.  Remember to drop the temp table at the end though, or it will throw an error the next time it tries to create it!

  • Depending on how you are going to use the tables you might want to consider using a work table instead.

    As Jeffrey mentions above you will need to drop the tables at the end if your package to prevent errors the next time you run. However, if you package errors before reaching these steps then the package will not error still on the next run. You can always build in the drop statement into your create statement (just test for it's existence when creating it).

    For my application I had more success with a permanent work table. I think I preferred this method especially when debugging the DTS package. That way you can just delete it before running and then have access to the data after the execution of the package. This also works great when building packages that will call another package and have access to the data.

    Hope that helps!

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

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