Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ANSI_PADDING ON and OFF
Message
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
ANSI_PADDING ON and OFF
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01556316
Message ID:
01556316
Views:
109
Hi,

I am creating a new SQL Server database, using a script generated from another database. When I executed the script, it runs, but in one place I get error:
CREATE INDEX failed because the following SET options have incorrect settings: 'ANSI_PADDING'. Verify that SET
 options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query 
notifications and/or XML data type methods and/or spatial index operations.
So I started looking through the script and see that there is SET ANSI_PADDING ON before every Create Table and then it is set to OFF. What is the purpose of this ON/OFF? And is there a way to find the place in the script (which is quite long) which causes the above error?

TIA.

UPDATE. I think I know what triggered the error. I added a Filtered index to one of the tables on which the script was generated. Apparently it is ok to add a filtered index in SSMS but when the script does it, the SET ANSI_PADDING conflicts.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Reply
Map
View

Click here to load this message in the networking platform