Can srv_paramsetoutput() be used to set nvarchar(max) or varchar(max)?

239 Views Asked by At

I'm writing an extended stored procedure for SQL Server in C++.

The user can provide OUT parameters which I can set using srv_paramsetoutput(). However, this seems to always fail when I try to set TEXT, VARCHAR(max) or NVARCHAR(max). Note that VARCHAR(max) is referred to internally as SRVBIGVARCHAR.

Is there a common mistake I could be making or are these datatypes inaccessible to xprocs when used as output parameters?

1

There are 1 best solutions below

3
On BEST ANSWER

The maximum length value that an extended stored procedure can return is 8000 (for Varbinary or Varchar) or 4000 (for nvarchar).