Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

String or binary data would be truncated. Expand / Collapse
Author
Message
Posted Sunday, December 02, 2007 9:48 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, March 28, 2014 9:13 PM
Points: 81, Visits: 384
I have a SP where i have given SET ANSI_WARNINGS ON. Inside the SP i am creating a temp table (# table) where i am inserting a record which is greater than its defined length. i.e the column of temp table is nvarchar(30) and i am trying to insert 31 characters. In one server the string data is truncated to 30 chars and inserted whereas when i execute the same in another server it is giving error like String or binary data would be truncated. Please provide the reason for this
Post #428579
Posted Sunday, December 02, 2007 10:33 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 1:55 AM
Points: 1,145, Visits: 846
Hi !
Increase the lenght of your column.
Post #428581
Posted Monday, December 03, 2007 6:18 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, March 28, 2014 9:13 PM
Points: 81, Visits: 384
Hi,

Thanks for the response. But my query is why the record is getting inserted in one Server by truncating the last character and why it is throwing the error in another server.
Post #428693
Posted Monday, December 03, 2007 6:25 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, October 21, 2013 12:32 AM
Points: 2,556, Visits: 2,593
Is the SET option defined at the PROCEDURE level?

--Ramesh

Post #428695
Posted Monday, December 03, 2007 11:49 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, March 28, 2014 9:13 PM
Points: 81, Visits: 384
Yes it is set in Procedure
Post #429120
Posted Friday, January 18, 2013 4:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, January 28, 2013 4:23 AM
Points: 1, Visits: 7
yes the set option is defined at the procedural level
Post #1408804
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse