Sunday, February 26, 2012

Error with an Insert stored procedure

I am getting this error when executing an insert procedure
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E57)
[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would
be truncated.The length of the string you are trying to insert is larger than the maximum
length of the column you are trying to insert into. Either the datatypes of
the parameters that the stored procedure accepts do not map to the datatypes
of the columns of the table you are trying to insert into, or the procedure
uses INSERT INTO without a column list and you are trying to insert the
wrong data in the wrong column.
Jacco Schalkwijk
SQL Server MVP
"Earnie" <Earnie@.discussions.microsoft.com> wrote in message
news:6831DA16-57F3-4920-A254-42D7A849BCD2@.microsoft.com...
>I am getting this error when executing an insert procedure
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E57)
> [Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would
> be truncated.|||Try
set ansi_warnings off
GO
before the instert statement.!|||1) You can't use GO in a stored procedure
2) Do you really want to make information disappear? What if someone types
in a description to store in your database and the last sentence is cut off
because it is too long and you have set ansi_warnings off? Don't you think
the users will prefer to be given a warning that the description is too long
so that they can reword it in less words?
Jacco Schalkwijk
SQL Server MVP
"Query Builder" <querybuilder@.gmail.com> wrote in message
news:1107473880.870415.62730@.l41g2000cwc.googlegroups.com...
> Try
> set ansi_warnings off
> GO
> before the instert statement.!
>

No comments:

Post a Comment