473,385 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Stored procedure returning wrong value because of ANSI_WARNINGS

I have been researching this problem for a week now and I haven't found anything that works. Here is the problem: We recently removed the SET ANSI_WARNINGS OFF code at the top of all of our triggers because they were causing way too many recompiles and we were seeing locking, blocking and timeouts. Unfortunately, we are now seeing many application errors (VB6) where the warnings are causing errors in our recordsets and return values. The default on the SQL Server database is set to OFF. I have now added "ansinpw=off;" to the connection string. I have even added the following:

Expand|Select|Wrap|Line Numbers
  1. Dim connCurrent As New ADODB.Connection
  2. connCurrent.Execute "SET ANSI_WARNINGS  OFF"
My question to all of you is where else might these be being set to on? It really isn't an option to include them in the offending triggers because of the locking issues?

Thanks very much for any insight you can give me.

Feb 8 '07 #1
5 2940
1,017 Expert 512MB
I think it should be in the same execute statement. It is only a guess.
Try this:

[PHP]Dim connCurrent As New ADODB.Connection
connCurrent.Execute "SET ANSI_WARNINGS OFF" & vbcrlf & "go" & vbcrlf & "execute your code here"[/PHP]

But you can go to the server and execute following line


If you see this record
ansi_warnings SET[/PHP]

It means that Server's ANSI_WARNINGS is on.

To changes global configuration settings for the current server use
sp_configure ......

I would recommend your DBA do it.
Feb 8 '07 #2
1,017 Expert 512MB
Also check your stored proc code to eliminate nulls in counts and group by.
Feb 8 '07 #3
Also check your stored proc code to eliminate nulls in counts and group by.
I'm beginning to think this is the only viable solution. Unfortunately, this will require more testing by QA and I was looking for a simpler solution. I know for a fact that the database default is to OFF because I ran the sql to verify the setting. It's included in the connection string, so where do you think this might be getting set to ON?
Feb 8 '07 #4
1,017 Expert 512MB
Did you try this?

Dim connCurrent As New ADODB.Connection
connCurrent.Execute "SET ANSI_WARNINGS OFF" & vbcrlf & "go" & vbcrlf & "execute your proc here" [/PHP]
Feb 8 '07 #5
1,017 Expert 512MB
You know, from my experience it could be if database was restored from another server where it was on at the time trigger\stored proc was created.

Did you try to drop \ recreate it again?

I am not authoritative source on it thou. I am a programmer like you not a DBA.
Feb 8 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

by: sbest | last post by:
Hi all, I am trying to execute a MS-SQL 2000 stored proedure from PHP 4.2.2 and return the single row of 3 output values. I've whittled down the error messages so that I'm now mainly getting an...
by: Josh Strickland | last post by:
I am attempting to create an Access database which uses forms to enter data. The issue I am having is returning the query results from the Stored Procedure back in to the Access Form. ...
by: David Lozzi | last post by:
Here is the proc: CREATE PROCEDURE . @CID as int, @Netname as nvarchar(25), @Return as int OUTPUT AS IF EXISTS (SELECT DISTINCT netname FROM computers WHERE CompanyID = @CID AND...
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL...
by: MDB | last post by:
Hello all, I know this may not be the correct group but was hoping someone could help anyway. I have a stored procedure that is not returning the correct information. For some reason it is not...
by: scparker | last post by:
Hello, We have a stored procedure that does a basic insert of values. I am then able to retrieve the ID number created for this new record. We are currently using ASP.NET 2.0 and use N-Tier...
by: fniles | last post by:
I am using VB.NET 2003 and SQL2000 database. I have a stored procedure called "INSERT_INTO_MYTABLE" that accepts 1 parameter (varchar(10)) and returns the identity column value from that table....
by: eholz1 | last post by:
Hello PHP group, Could someone help me out? I have PHP 5.2, Apache 2.0, and MySQL 5.0 running on Linux (Redhat Fedora Core 6). All that works fine. I would like to be able to "call" a stored...
by: bbawa1 | last post by:
I have a stored procedure which is returning an int. Could you pleasde give me ADO.Net code that how can I retrieve the returning value from from stored procedure in aspx page and put that...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.