Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
We have a char(1) in the database. Corresponding field is boolean in application code and is mapped to YesNoType. Mapping is done through code. NHibernate query generates a parameter of char(8000) which holds either 'Y' or 'N'. This results in below error:

Creating or altering table 'FakeWorkTable' failed because the minimum row size would be 16017, including 4 bytes of internal overhead. This exceeds the maximum allowable table row size of 8094 bytes.

We are using nHibernate LINQ for querying.

Is there any way to explicitly mention the length and type of parameter. Quick help and suggestion will be really appreciated. nHibernate jira discuss the same issue but have not provided any solution/workaround for the same.

NHibernate generated query obtained from SQL Profiler:

    SELECT this_.AlertID as AlertID1_0_, 
this_.RV as RV1_0_, 
this_.CaseID as CaseID1_0_, 
this_.Description as Descript4_1_0_,
this_.GeneratedByObjectID as Generate5_1_0_, 
this_.GeneratedByObjectTypeID as Generate6_1_0_,
this_.RelatedObjectTypeID as RelatedO7_1_0_, 
this_.RelatedObjectID as RelatedO8_1_0_, 
this_.IsClosed as IsClosed1_0_, 
this_.CreatedDate as Created10_1_0_,
this_.ClosedDate as ClosedDate1_0_, 
this_.CloseComments as CloseCo12_1_0_,
this_.CreatedByUserID as Created13_1_0_, 
this_.ClosedByUserID as ClosedB14_1_0_, 
this_.ClosureReasonID as Closure15_1_0_ FROM trans.Alert this_ WHERE 
this_.GeneratedByObjectTypeID = @p0 and this_.GeneratedByObjectID = @p1 and 
not (this_.IsClosed = @p2)
Name:@p0 - Value:1 Name:@p1 - Value:1775549 Name:@p2 - Value:'Y'

N'@p2 char(8000)',N'@p1 int', N'@p0 int'  

What I have tried:

Changing from LINQ to HQL and specifying length explicitly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900