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.
Author |
Topic |
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-07-12 : 16:58:26
|
Guys,Each time I try to create a stored proc I get the following error.Msg 1934, Level 16, State 1, Procedure ddlDatabaseTriggerLog, Line 17SELECT failed because the following SET options have incorrect settings: 'ANSI_NULLS, QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods.I ran following statements to set the defaults, but didnt seem to work either.Alter Database MASTER SET arithabort OnAlter Database MASTER SET ANSI_NULLS OnAlter Database MASTER SET CONCAT_NULL_YIELDS_NULL OnAlter Database MASTER SET QUOTED_IDENTIFIER OnAny suggestions and inputs would helpThanks |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-07-12 : 17:25:51
|
Do the SEt statements in your stored procedure.Oh, and I hope making those changes to the MASTER database doesn't cause you a problem.CODO ERGO SUM |
 |
|
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-07-13 : 09:03:19
|
Micheal,I am trying to create the stored proc from the following linkhttp://vyaskn.tripod.com/code/generate_inserts_2005.txtIn this stored proc as suggested by you I have embedded the following code which sets the defaults on the database level.Still doesnt seem to work. Strange thing to note is the same stored proc works on different sql server instance without changing the defaults at the database level. And all the defaults across the two sql server instances is same. @sql nvarchar(200), @SQL1 nvarchar(200), @SQL2 nvarchar(200), @SQL3 nvarchar(200) set @sql = N'BEGIN Alter Database MASTER SET ANSI_NULLS On END' set @sql1 = N'BEGIN Alter Database MASTER SET arithabort On END' set @sql1 = N'BEGIN Alter Database MASTER SET CONCAT_NULL_YIELDS_NULL On END' set @sql1 = N'BEGIN Alter Database MASTER SET QUOTED_IDENTIFIER On END' EXEC SP_EXECUTESQL @SQL EXEC SP_EXECUTESQL @SQL1 EXEC SP_EXECUTESQL @SQL2 EXEC SP_EXECUTESQL @SQL3Any suggestions and inputs would help.ThanksSri |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-07-13 : 09:28:07
|
I didn't say to Alter the master database in you stored procedure. You really shouldn't make changes like that to the Master database.Just run SET statements to change the values for your session:SET ANSI_NULLS OnSET arithabort OnSET CONCAT_NULL_YIELDS_NULL OnSET QUOTED_IDENTIFIER On CODO ERGO SUM |
 |
|
|
|
|
|
|