TypedList Pageing SQL 2005 nvarchar(MAX) bug

Posts   
 
    
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 13-Mar-2006 20:51:42   

Ok,

When paging using a typedList i get this error.

The size (2147483647) given to the column 'Description' exceeds the maximum allowed for any data type (8000).

Here is the query its generating..


exec sp_executesql N'CREATE TABLE #TempTable ([__rowcnt][int] IDENTITY (1,1) NOT NULL,[Id][UniqueIdentifier] NULL,[CatalogName][NVarChar](100) 
NULL,[Description][NVarChar](2147483647) NULL,[ModifiedDate][DateTime] NULL,[CreatedDate][DateTime] NULL);INSERT INTO #TempTable 
([Id],[CatalogName],[Description],[ModifiedDate],[CreatedDate]) SELECT DISTINCT TOP 3 [Mingus].[dbo].[Catalog].[Id], 
[Mingus].[dbo].[Catalog].[CatalogName], [Mingus].[dbo].[Catalog].[Description], [Mingus].[dbo].[Catalog].[ModifiedDate], 
[Mingus].[dbo].[Catalog].[CreatedDate] FROM [Mingus].[dbo].[Catalog] ;SELECT [Id],[CatalogName],[Description],[ModifiedDate],[CreatedDate] FROM 
#TempTable WHERE [__rowcnt] > @__rownoStart AND [__rowcnt] <= @__rownoEnd ORDER BY [__rowcnt] ASC;DROP TABLE #TempTable',N'@__rownoStart 
int,@__rownoEnd int',@__rownoStart=1,@__rownoEnd=2

Description is a nvarchar(MAX) field, if manually excute this query and change


[Description][NVarChar](2147483647) NULL

To


[Description][NVarChar](MAX) NULL

The query executes just fine...

I think is prolly a simple fix check to see if siz eis over 8000, if it is then insert MAX instead wink

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 13-Mar-2006 22:04:14   

I've to check if the MAX field indeed is generated as a MAX field and not as a varchar with 2gb size.

(edit): Size is a numeric value, so 'max' isn't available at runtime. I've indeed to implement a check for large values to overcome this issue till v2 is available which uses a CTE for paging on SQLServer 2005

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 14-Mar-2006 10:43:36   

Fixed in next build.

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 14-Mar-2006 16:42:50   

Thank You simple_smile