显示标签为“effect”的博文。显示所有博文
显示标签为“effect”的博文。显示所有博文

2012年2月11日星期六

ANSI_WARNINGS inconsistently in effect

I have written a VB.Net application using a SQLConnection to connect to a SQL
2000 database. The application uses an update statement in a SQLDataAdapter
to make changes to a table on the server.
The problem is that one client is getting an error with the update failing
due to string truncation. The other clients do not get an error. The only
part of the string in question that matters is the first letter, so there is
no data integrity issue.
I realize that I could put the update in a stored proc and set ANSI_WARNINGS
OFF, and then call the proc. But, I was interested in why this only is a
problem on one client.
The ANSI_WARNINGS db_option for the database is FALSE. I have searched the
MS KB and used Google Groups to search microsoft.public.* to no avail.
From what I have read, there is no way to set ANSI_WARNINGS for the
SQLConnection object. The thing that confuses me is why all clients are fine
except that one. From what I can determine, all have the same version of SQL
Server ODBC driver, etc.
Any suggestions would be appreciated.
It could be that, that particular client's table structure is different.
Check and make sure that table's column widths are the same as the ones on
the other databases.
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"A. Powers" <APowers@.discussions.microsoft.com> wrote in message
news:28CE89D3-8B4A-4218-8306-1168274499B7@.microsoft.com...
I have written a VB.Net application using a SQLConnection to connect to a
SQL
2000 database. The application uses an update statement in a SQLDataAdapter
to make changes to a table on the server.
The problem is that one client is getting an error with the update failing
due to string truncation. The other clients do not get an error. The only
part of the string in question that matters is the first letter, so there is
no data integrity issue.
I realize that I could put the update in a stored proc and set ANSI_WARNINGS
OFF, and then call the proc. But, I was interested in why this only is a
problem on one client.
The ANSI_WARNINGS db_option for the database is FALSE. I have searched the
MS KB and used Google Groups to search microsoft.public.* to no avail.
From what I have read, there is no way to set ANSI_WARNINGS for the
SQLConnection object. The thing that confuses me is why all clients are
fine
except that one. From what I can determine, all have the same version of
SQL
Server ODBC driver, etc.
Any suggestions would be appreciated.

2012年2月9日星期四

ANSI Nulls SQL Server Setting

Should I be using the SQL Server 2000 ANSI warnings, ANSI padding, ANSI nulls
since I'm using the ANSI-92 joins in my T-SQL statements?
What effect will this have on database performance with this disable?
What reason should you have that SQL Server ANSI warnings, ANSI padding,
ANSI nulls are turn off?
Please help me with these answer?
Thank You,
ANSI_NULLS, ANSI_PADDING and ANSI_WARNINGS are not needed to use ANSI-92
joins.
The most important of these to consider in your queries is ANSI_NULLS, which
defines the behavior when comparing null values. But this is important even
if you are using ANSI-92 joins or not.
See 'Setting Database Options' on SQL Server 2000 BOL for more information.
Ben Nevarez
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:D9C612A2-4B76-4A13-A226-D85BDC2C1422@.microsoft.com...
> Should I be using the SQL Server 2000 ANSI warnings, ANSI padding, ANSI
> nulls
> since I'm using the ANSI-92 joins in my T-SQL statements?
> What effect will this have on database performance with this disable?
> What reason should you have that SQL Server ANSI warnings, ANSI padding,
> ANSI nulls are turn off?
> Please help me with these answer?
> Thank You,