473,396 Members | 2,106 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,396 software developers and data experts.

Error message "String or Binary data would be trunicated", " The statement has been terminated"

Dear All,

I have written an update trigger that should write a message to an audit
table When I try to update any field in the table I recieve the following
error message -

[ODBC Sql Server Driver] [Sql Server] Stirng or Binary data would be
trunicated
[ODBC Sql Server Driver] [Sql Server] The statement has been termined.

I have looked and what has been suggested is to use the response.write len()
to check the length of field that I am updating. Being fairly new to
SQL-Server, I do not know how to do this. Any help will be most welcome.

Thanks,

Jeff
Jul 20 '05 #1
2 5223
[posted and mailed. please reply in news]

Jeff Magouirk (ma*******@njc.org) writes:
I have written an update trigger that should write a message to an audit
table When I try to update any field in the table I recieve the following
error message -

[ODBC Sql Server Driver] [Sql Server] Stirng or Binary data would be
trunicated
[ODBC Sql Server Driver] [Sql Server] The statement has been termined.

I have looked and what has been suggested is to use the response.write
len() to check the length of field that I am updating. Being fairly new
to SQL-Server, I do not know how to do this. Any help will be most
welcome.


The message means that you try to squeeze in a string into a column which
does not fit the string.

Judging from your description, the problem is in the trigger, so that is
probably the code you need to scrutinize. Response.write len() sounds
like somethnig webbish, so that is not likely to help you.

A common error is to declare a column as varchar, without specifying
any length. This results in a default of 1. In difference to client
languages, a string always has a max length in SQL. (Which has to do
with the fact that the string is to be persisted on disk.)

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
Jeff Magouirk wrote:
I have looked and what has been suggested is to use the
response.write len() to check the length of field that I am updating.
Being fairly new to SQL-Server, I do not know how to do this. Any
help will be most welcome.


Response.Write is an ASP thing, not a SQL thing. You can't reference
Response.Write within a trigger. Post your trigger and let's see what you
have. The error indicates that you are trying to put a string into a field
and the string is longer than the field is declared to be. You can suppress
the error with SET ANSI_WARNINGS OFF, but the data itself will still be
truncated to fit the field.

--
Steve Troxell
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: newbie_mw | last post by:
Seems my post was buried in more cries for help :-) I will try again. It's probably a very novice question so please take a look! Thanks!...
2
by: srktnc | last post by:
When I run the program, I get a Debug Error saying "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more...
3
by: NeilH | last post by:
Hello All I was wondering if someone could offer a rather inexperienced person some advice. Im trying to get my asp page to look at an access data I created the following query in access...
4
by: Daedric | last post by:
Hello and thanks in advance to anyone who offers help. To make this simple, let's say I have a game which has 100 different monsters. I want a binary data file to hold all of these. It would...
1
by: Marc Bishop | last post by:
can anyone help me with this? Code Snippet: Dim ArrCart As New ArrayList() if NOT Session("sesCart") = "" then ArrCart = Session("sesCart") Error: System.InvalidCastException: Operator is...
9
by: rsine | last post by:
I have developed a program that sends a command through the serial port to our business system and then reads from the buffer looking for a number. Everything worked great on my WinXP system, but...
3
by: nsh | last post by:
mailing.database.mysql, comp.lang.php subject: does "LOAD DATA" EVER work?!? I've tried EVERYTHING! version info: my isp is running my web page on a linux box with php ver. 4.4.1 according to...
10
by: lovecreatesbea... | last post by:
Is it correct and safe to compare a string object with "", a pair of quotation marks quoted empty string?If the string object: s = ""; does s contain a single '\'? Is it better to use...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
0
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...
0
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.