August 12, 2009 at 5:08 am
Is it possible to preserve rows on commit for temporary tables in MSSQL? What is the default manner of commit (for temp tables)?
Thanks
Viv
August 12, 2009 at 6:16 am
Sorry, don't understand what you're asking. Transaction behaviour for Temp tables is pretty much the same as for normal tables.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 12, 2009 at 6:27 am
Not really sure what you are asking here. Could you provide more information about what you are trying to accomplish?
August 12, 2009 at 6:38 am
What I want to accomplish is following:
For example in Oracle when we create temporary tables we have an option like this:
CREATE GLOBAL TEMPORARY TABLE
...............
ON COMMIT DELETE ROWS
OR
ON COMMIT PRESERVE ROWS
So that when a commit is issued in the database the rows of the temp table will be deleted or preserved.
I want to ask whether it is possible to preserve rows in MSSQL.
What is the default ?
Thanks
August 12, 2009 at 6:44 am
If you insert rows into a temp table in SQL and commit the transaction, the rows will be in the temp table until they are deleted or the temp table is dropped.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply