SQL Server Stored Procedure parameter > varchar(4000)

Posts   
 
    
englandm
User
Posts: 5
Joined: 19-Nov-2013
# Posted on: 19-Nov-2013 15:35:32   

Hi

I'm using LLBLGen Pro version 3.5 Final (January 17th, 2013) with SQL Server 2008 R2

When retrieving the following stored procedure, I end up with 1 resultset (as expected) that I can reverse into a TypedView

CREATE PROCEDURE [dbo].[test] @filter_codes VARCHAR(4000) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;

-- Insert statements for procedure here
SELECT * FROM discipline

END

However, if I modify the size of the parameter to 4001 (or higher), I end up with no resultsets.

Any help appreciated.

Matt

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 19-Nov-2013 15:53:51   

Please check the application output pane in the designer for the error message, which should give more insight in why it didn't work

Frans Bouma | Lead developer LLBLGen Pro
englandm
User
Posts: 5
Joined: 19-Nov-2013
# Posted on: 19-Nov-2013 17:27:35   

Application Output pane contains:-

Relational Model data Retrieval::Stored procedure 'test' caused an exception during resultset retrieval. Its resultsets (if any) probably aren't determined in full: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 ("@filter_codes"): Data type 0xE7 has an invalid data length or metadata length.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 19-Nov-2013 21:51:39   

Please correct me if I'm wrong. DbType.String is always in Unicode format, so its maximum allowed size is 4000 characters (8000 bytes).

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 20-Nov-2013 11:15:47   

Could you try Varchar(MAX) ? (which is essentially TEXT) ?

@Walaa, I think that's true for NVarchar, the parameter here is Varchar (non-unicode). Not sure though... It might be a bug in the driver code. If varchar(max) fails as well, we've to look into this.

Frans Bouma | Lead developer LLBLGen Pro
englandm
User
Posts: 5
Joined: 19-Nov-2013
# Posted on: 20-Nov-2013 14:35:37   

Varchar(MAX) fixed it

Many thx