I am using a dynamic stored procedure, the parameter value is really long (more than 8000 characters).
And another stored procedure is calling inside the dynamic query (@SP), when I execute the SP the parameter being truncated.
How can I get the entire parameter? Did I miss some thing??
Because of this I am unable to execute the query.
ALTER PROCEDURE [dbo].["SP_NAME"]
@ID varchar(50),
@<parameter> nvarchar(max),
AS
SET NOCOUNT ON
DECLARE @SP nvarchar(MAX)
set @SP = '
DECLARE @sampleNVARCHAR nvarchar(MAX)
SET @sampleNVARCHAR= '''+ @<parameter>+ '''
EXEC <anotherSP> @sampleNVARCHAR,'+ cast(@CLIENTOFFSET as varchar(10)) +''
EXEC sp_executesql @SP
RETURN
anotherSPdeclared?@<parameter>in the sp body. Is it printing all the 8000 characters?