Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String or binary data would be truncated
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01310262
Message ID:
01310393
Views:
32
>>I succeeded to bypass that issue by adding this in the oCommand.CommandText in my SQLUpdate() and SQLInsert() methods:
>>
>>
>>                ' In SQL Server, we have to turn off ANSI Warnings as we will have an error
>>                ' if a field value is greater than the field length
>>                If nBackend = 2 Then
>>                    oCommand.CommandText = "SET ANSI_WARNINGS OFF; " + oCommand.CommandText
>>                End If
>>
>>
>>However, this is effective for all updates or inserts in a hit. If anyone would have a simpler method where the setting would only be set once per hit, that would be great.
>
>Hi Michel,
>
>I was reading on these settings yesterday in the SQL Server book I have and it is said that the connection setting overwrites database setting. Perhaps you can set it per connection?
>
>UPDATE. I tried to search on google how to set it per connection, but nothing good comes up so far :(

Looking through http://msdn2.microsoft.com/en-us/library/ms130822(SQL.100).aspx
and http://www.connectionstrings.com/?carrier=sqlserver2005

I believe you can add ;AnsiNPW = no at the end of your connection string.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform