String or binary data would be truncated

This forum is where we'll mirror posts that are of value to the community so they may be more easily found.
Post Reply
User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

String or binary data would be truncated

Post by nickc » Fri Feb 06, 2009 6:39 pm

Just installed Live meeting, and look at my cool new user-agent string:

Code: Select all

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8)
It's a nifty 266 characters long!

Oops... Able no likely...

Code: Select all

[SqlException (0x80131904): String or binary data would be truncated. The statement has been terminated.]
 ...
   CommerceBuilder.Reporting.PageView.Save() +1469
 ...
Recommend changing all columns in ac_PageViews with nvarchar(255) to nvarchar(MAX).

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: String or binary data would be truncated

Post by jmestep » Fri Feb 06, 2009 6:44 pm

Does that happen even with this patch in the Global.asax?

protected void Session_OnStart()
{
//SAVE THE REFERRER FOR USE BY THE ORDER MODULE
if (Request.UrlReferrer != null) Session["SessionReferrerUrl"] = StringHelper.Truncate(Request.UrlReferrer.ToString(), 255);
}
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: String or binary data would be truncated

Post by nickc » Sat Feb 07, 2009 1:02 am

Yes, the UA is being written as ac_PageViews.UserAgent.
It would be nice if one could disconnect the page logging in Able completely. It lacks the notion of session; I've written a custom logger that does session, records common objects (like product page views) as separate columns, also can be used to capture ad-hoc events (button, link clicks; other specific actions; etc.). Splitting into 2 tables (SessionLog, PageViewLog) makes page view storage more compact as session data is not stored in every PageView record - just the session id.
This one was a head scratcher because I expected it to be the referrer - except IE was failing while FF worked.
MS appears to be using the UA as a dumping ground for installed .NET versions - Live Meeting pushed it over the edge.
No way of knowing how many site users may have encountered this in the past, but I'm guessing the long UA is not that common.

Post Reply