dbTalk Databases Forums  

Too Many SET Options

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Too Many SET Options in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dil
 
Posts: n/a

Default Too Many SET Options - 03-10-2006 , 07:52 AM






Hi

I have created a Sql Script through Enterprise Manager for Drop a
column. By default its creating lot of 'SET' commands. I doubt all
these SET options are required or not. Pls comment on this issue

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
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
ALTER TABLE Employee
DROP COLUMN OrderDetails_ID
GO
COMMIT


Dil


Reply With Quote
  #2  
Old   
ZeldorBlat
 
Posts: n/a

Default Re: Too Many SET Options - 03-10-2006 , 08:50 AM







Dil wrote:
Quote:
Hi

I have created a Sql Script through Enterprise Manager for Drop a
column. By default its creating lot of 'SET' commands. I doubt all
these SET options are required or not. Pls comment on this issue

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
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
ALTER TABLE Employee
DROP COLUMN OrderDetails_ID
GO
COMMIT


Dil
Here's something you can try:

Remove all the SET statements
Run the script
See what happens



Reply With Quote
  #3  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Too Many SET Options - 03-10-2006 , 05:35 PM



Dil (dilishtv (AT) gmail (DOT) com) writes:
Quote:
I have created a Sql Script through Enterprise Manager for Drop a
column. By default its creating lot of 'SET' commands. I doubt all
these SET options are required or not. Pls comment on this issue
First of all, the scripts that are generated through EM requires
careful review, as there are several serious bugs in the Table Designer
when it comes to modifing tables. All these bugs are in Mgmt Studio in
SQL 2005 as well, by the way.

I guess the SET commands are there, in case an operation would require
the script to work with an indexed view or an indexed computed column.
These two features requires the settings in the script, except for the
isolation level setting.

There is however a minor flaw with the SET commands. To wit, when you
create a varchar/varbinary column, the setting of ANSI_PADDING is saved
with that column. Say now that you make a change to a table, which requires
the table designer to recreate the table. It will now recreate all
columns with SET ANSI_PADDING ON, even if they were originall created
with padding off. Since a table could, at least theoretically, have a mix
of settings, it would be a lot of work to retain the setting.




--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.