When I do this to insert the parameter into a column that is varchar(max) as defined in the tableedit: the declareDECLARE @s datetime, @e datetime, @Error_Type int, @Error_Loc int, @sprc int, @Parameters varchar(MAX), @Sprocname varchar(255), @res_version int, @res_cd int, @path_id int, @resource_count int, @count int, @count2 int, @res_name varchar(255)The DDL:CREATE TABLE [dbo].[SprocExecLog]( [SprocName] [varchar](256) NOT NULL, [TranStart] [datetime] NOT NULL, [TranEnd] [datetime] NOT NULL, [LogStart] [datetime] NOT NULL, [LogEnd] [datetime] NOT NULL, [ReturnCode] [int] NULL, [ErrorCode] [int] NULL, [ErrorMessage] [varchar](4000) NULL, [Rows] [int] NOT NULL, [App_User] [varchar](30) NOT NULL, [Sys_User] [varchar](30) NOT NULL, [User_Name] [varchar](30) NOT NULL, [Host_Name] [varchar](256) NOT NULL, [Parameters] [varchar](max) NULL) ON [PRIMARY] SET @Parameters = 'DECLARE @rc int, @Error int, @Error_Message varchar(255), @Rowcount int; '+CHAR(13)+CHAR(10) + 'EXEC ' + @SprocName +CHAR(13)+CHAR(10) + ' @DATA=' + COALESCE(CHAR(39)+@DATA+CHAR(39),'NULL')+CHAR(13)+CHAR(10) + ', @User=' + COALESCE(CHAR(39)+@User+CHAR(39),'NULL')+CHAR(13)+CHAR(10) + ', @rc=@rc OUTPUT, @Error=@Error OUTPUT, @Error_Message=@Error_Message OUTPUT, @Rowcount=@Rowcount OUTPUT; '+CHAR(13)+CHAR(10) + 'SELECT @rc AS [RC], @Error AS [Error], @Error_Message AS [Error_Message], @Rowcount AS [RowCount]' EXEC [isp_LOG_SprocExecLog] @Sprocname, @s, @e, @rc, @Error, @Error_Message, @Rowcount, @User, @Parameters, @sprc OUTPUT
The results seem truncated.When I check the tableSELECT TOP 1 LEN(Parameters) FROM SprocExecLogWHERE SprocName = 'USP_INS_ADMIN_DETAILS'ORDER BY TranStart DESC
I get 4000Any ideas why?Is it a buffer thing?Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/