c++sql-serverextended-procedures

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


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?


Solution

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