473,796 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stored procedure returning wrong value because of ANSI_WARNINGS

2 New Member
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=of f;" 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"
  3.  
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.

Laurie
Feb 8 '07 #1
5 2961
iburyak
1,017 Recognized Expert Top Contributor
I think it should be in the same execute statement. It is only a guess.
Try this:

[PHP]Dim connCurrent As New ADODB.Connectio n
connCurrent.Exe cute "SET ANSI_WARNINGS OFF" & vbcrlf & "go" & vbcrlf & "execute your code here"[/PHP]

But you can go to the server and execute following line

[PHP]DBCC USEROPTIONS[/PHP]

If you see this record
[PHP]
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
iburyak
1,017 Recognized Expert Top Contributor
Also check your stored proc code to eliminate nulls in counts and group by.
Feb 8 '07 #3
Laurie Murphy
2 New Member
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
iburyak
1,017 Recognized Expert Top Contributor
Did you try this?

[PHP]
Dim connCurrent As New ADODB.Connectio n
connCurrent.Exe cute "SET ANSI_WARNINGS OFF" & vbcrlf & "go" & vbcrlf & "execute your proc here" [/PHP]
Feb 8 '07 #5
iburyak
1,017 Recognized Expert Top Contributor
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

0
1352
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 error message that the MS-SQL Query ($sql) failed. Here's the stored procedure statements that define the input and output variables: CREATE PROCEDURE dbo.sl_mostrecent_State
2
11709
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. tCetecM1CUST (SQL Table that contains the Customer Information) tAccountingDetail (SQL Table that contains the information in the form) frmAccountingEntry (Access form used to enter data) spGetCustomerInformation (Stored Procedure which returns data using...
6
2267
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 UPPER(netname) = UPPER(@Netname))
7
2240
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 tabel. I know the SP works, because a smalldatetime-field in the database is changed. I've tried to disable viewstate on all textbox controls. Any ideas to solve this problem.
1
1083
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 returning the correct lane or reference number and was wondering if someone can take a look and help figure out why. Here is the asp.net code: OleDbCommand cmd = new OleDbCommand ( "Get_CCAuth_Lane", conn ); cmd.CommandType =...
4
4363
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 Architecture. The Stored Procedures are used through TableAdaptors, which in turn are used by Class Files. I wish to be able to return this new ID value using the Stored
9
4147
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. When calling the stored procedure from VB.NET, in the CommandText, can I just say "INSERT_INTO_MYTABLE '12345'" instead of calling it with "INSERT_INTO_MYTABLE" then do the following : OleDbCommand2.Parameters.Add("@Account", SqlDbType.VarChar, 10)...
7
5846
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 procedure from a PHP program, and run a stored procedure. I have yet to figure out the proper way to do this. My stored procedures work fine from the mysql command line using syntax: "call sp_min_record (101);"
2
480
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 returning value in a variable. Thanks
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9525
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10221
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.