Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 auto script in EM question

Author  Topic 

influent
Constraint Violating Yak Guru

367 Posts

Posted - 2007-03-08 : 17:46:05
Whenever I do Save Change Script in EM the script that it gives me starts with the following:

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
...

Is that really doing anything? If it's committing the SET statements before it starts the pertinent transaction, are the settings still used? If so, why put them in a transaction?

rlaubert
Yak Posting Veteran

96 Posts

Posted - 2007-03-09 : 13:14:59
SQL does this to make sure that the transaction context is the same for execution as it was for the design. For example, lets say you designed a query using collation settings of case insensitive and you run the query on a machine that is set to case sensitive. The results would be different. If you run statements like above each time you ensure that the machine is configured the way the script was designed for.

Raymond Laubert
MCDBA, MCITP:Administration, MCT
Go to Top of Page

influent
Constraint Violating Yak Guru

367 Posts

Posted - 2007-03-12 : 17:51:31
Maybe I'm just dense, but I still don't understand why all those SET statements are in a transaction of their own...
Go to Top of Page
   

- Advertisement -