Re: Too Many SET Options



Dil (dilishtv@xxxxxxxxx) writes:
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@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: 3 Simple Security SQL Statements
    ... If you run the SELECT in a query window, it generates the list of commands ... There is procedure called sp_executesql that will take a string and execute ... Kalen Delaney, SQL Server MVP ... Builds a list of text commands. ...
    (microsoft.public.sqlserver.security)
  • Re: 3 Simple Security SQL Statements
    ... Builds a list of text commands. ... You could also use a DDL trigger to grant rights to WebUserRole ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.security)
  • Re: newbie problem: updating an access db
    ... modifying the code to use SQL Server it still exhibited the same ... changed the path to the supplied access .mdb file in the web.config ... the delete and update commands, so now they just test whether Adnum= ?. ... get this code to work, I don't want to start modifying it to use MSSQL, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: A desperate plea for help....
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... app in which collects data from a wedge scanner via barcodes. ... I have created the sql connection, data adapter, and data set as ... and DELETE commands with the text strings. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: HOW TO SEARCH FOR FILES ON WINDOWS 2008
    ... Does anybody know where Microsoft hid the SEARCH function? ... Some commands and options I find useful - ... They even have examples of how to search a URL or the entire world wide web on their web site. ... SQL Server Table Valued Parameters / Types - Multiple Row Inserts ...
    (microsoft.public.windows.server.general)