SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Setting database defaults
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 07/12/2007 :  16:58:26  Show Profile  Reply with Quote
Guys,

Each time I try to create a stored proc I get the following error.

Msg 1934, Level 16, State 1, Procedure ddlDatabaseTriggerLog, Line 17
SELECT 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 On
Alter Database MASTER SET ANSI_NULLS On
Alter Database MASTER SET CONCAT_NULL_YIELDS_NULL On
Alter Database MASTER SET QUOTED_IDENTIFIER On

Any suggestions and inputs would help

Thanks

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 07/12/2007 :  17:25:51  Show Profile  Reply with Quote
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

Edited by - Michael Valentine Jones on 07/12/2007 17:28:10
Go to Top of Page

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 07/13/2007 :  09:03:19  Show Profile  Reply with Quote
Micheal,

I am trying to create the stored proc from the following link

http://vyaskn.tripod.com/code/generate_inserts_2005.txt

In 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 @SQL3

Any suggestions and inputs would help.

Thanks
Sri
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 07/13/2007 :  09:28:07  Show Profile  Reply with Quote
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 On
SET arithabort On
SET CONCAT_NULL_YIELDS_NULL On
SET QUOTED_IDENTIFIER On



CODO ERGO SUM
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000