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.

没有评论:

发表评论