﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / String or binary data would be truncated. / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 06:41:56 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>[quote][b]Sean Lange (9/27/2012)[/b][hr][quote][b]Luis Cazares (9/27/2012)[/b][hr]I disagree, varchar can hold up to 8000 characters in 2000 (nvarchar will only hold up to 4000, though).[url]http://msdn.microsoft.com/en-us/library/aa258242(SQL.80).aspx[/url]Another option is to use text columns[/quote]Doh!!! You are right Luis, thanks for the correction to my incorrect correction. ;-)I too haven't 2000 in a long long time.[/quote]I remember the number because of the 8K Splitter.;-)I just had to find the reference to confirm it.</description><pubDate>Thu, 27 Sep 2012 12:10:32 GMT</pubDate><dc:creator>Luis Cazares</dc:creator></item><item><title>RE: String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>[quote][b]Luis Cazares (9/27/2012)[/b][hr]I disagree, varchar can hold up to 8000 characters in 2000 (nvarchar will only hold up to 4000, though).[url]http://msdn.microsoft.com/en-us/library/aa258242(SQL.80).aspx[/url]Another option is to use text columns[/quote]Doh!!! You are right Luis, thanks for the correction to my incorrect correction. ;-)I too haven't 2000 in a long long time.</description><pubDate>Thu, 27 Sep 2012 11:54:54 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>I disagree, varchar can hold up to 8000 characters in 2000 (nvarchar will only hold up to 4000, though).[url]http://msdn.microsoft.com/en-us/library/aa258242(SQL.80).aspx[/url]Another option is to use text columns</description><pubDate>Thu, 27 Sep 2012 10:00:30 GMT</pubDate><dc:creator>Luis Cazares</dc:creator></item><item><title>RE: String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>Oops! :blush:Thanks Sean!Haven't used it in many years.</description><pubDate>Thu, 27 Sep 2012 08:58:10 GMT</pubDate><dc:creator>Dennis Post</dc:creator></item><item><title>RE: String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>[quote][b]D.Post (9/27/2012)[/b][hr]Hi, Before inserting the data, find out what the MAX(LEN(Col)) is for each column. Compare the results to your variable declarations and destination table design.Btw, varchar(max) isn't recognized in SQL 2000. Better find out what it needs to be at the moment and add a little buffer. But if must be as big as possible use varchar(8000) instead.Goodluck.[/quote]varchar(4000) is the largest size in sql 2000. :-D</description><pubDate>Thu, 27 Sep 2012 07:35:41 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>Hi, Before inserting the data, find out what the MAX(LEN(Col)) is for each column. Compare the results to your variable declarations and destination table design.Btw, varchar(max) isn't recognized in SQL 2000. Better find out what it needs to be at the moment and add a little buffer. But if must be as big as possible use varchar(8000) instead.Goodluck.</description><pubDate>Thu, 27 Sep 2012 07:30:36 GMT</pubDate><dc:creator>Dennis Post</dc:creator></item><item><title>RE: String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>That is one of the most irritating things about sql server. There is a connect issue somewhere to change the message of that error to include the column name. DUH!!! Of course the engine knows which column threw the error, not returning it in the error message is just sad.</description><pubDate>Wed, 26 Sep 2012 07:57:13 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>It got resolved by changing VCHMESSAGE VARCHAR(800)to VCHMESSAGE VARCHAR(max)</description><pubDate>Wed, 26 Sep 2012 01:28:29 GMT</pubDate><dc:creator>mahesh.dasoni</dc:creator></item><item><title>RE: String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>I'd say you need to expand the size of one or more of your varchar columns.  Not sure which but that's where I'd start.  My google-fu isn't very strong today.</description><pubDate>Wed, 26 Sep 2012 01:10:20 GMT</pubDate><dc:creator>Lynn Pettis</dc:creator></item><item><title>String or binary data would be truncated.</title><link>http://www.sqlservercentral.com/Forums/Topic1364400-146-1.aspx</link><description>I am getting error in below code:SET NOCOUNT ON                CREATE TABLE #EVENTS (LOGDATE DATETIME, PROCESSINFO VARCHAR(50), VCHMESSAGE VARCHAR(800), SOURCE VARCHAR(20), CROW INT)                -- CHECK FOR SQL INSTALLATION WHETHER IF 2000 OR 2005 --        -- IN CASE OF 2000, XP_READERRORLOG GIVES ONLY SQL SERVER LOGS AND OUTPUTS ONLY 2 COLUMNS --        -- IN CASE OF 2005, XP_READERRORLOG GIVES BOTH SQL SERVER AND AGENT LOGS --                IF (SELECT LEFT(CAST(SERVERPROPERTY('PRODUCTVERSION') AS VARCHAR),1)) = 8         BEGIN          INSERT INTO #EVENTS (VCHMESSAGE, CROW) EXEC XP_READERRORLOG                  UPDATE #EVENTS SET LOGDATE = SUBSTRING(VCHMESSAGE,1,19), PROCESSINFO = 'SERVER', SOURCE = 'SQL SERVER'           WHERE SUBSTRING(VCHMESSAGE,1,3)='200' and substring(VCHMESSAGE,5,5)='-'                 END        ELSE           BEGIN            INSERT INTO #EVENTS (LOGDATE, PROCESSINFO, VCHMESSAGE) EXEC XP_READERRORLOG 0,1 -- CURRENT LOGS, SQL SERVER          UPDATE #EVENTS SET SOURCE = 'SQL SERVER'                  INSERT INTO #EVENTS (LOGDATE, PROCESSINFO, VCHMESSAGE) EXEC XP_READERRORLOG 0,2 -- CURRENT LOGS, SQL SERVER AGENT          UPDATE #EVENTS SET SOURCE = 'SQL SERVER AGENT' WHERE SOURCE IS NULL         END The error which i am getting is :Msg 8152, Level 16, State 2, Procedure xp_readerrorlog, Line 1String or binary data would be truncated.Please if some can help......</description><pubDate>Tue, 25 Sep 2012 20:24:43 GMT</pubDate><dc:creator>mahesh.dasoni</dc:creator></item></channel></rss>