For capturing the values, you'll need dynamic SQL.I dynamically generate static code to capture the parameter values in the error-handling code in the proc. That makes the process less error-prone and reduces run-time overhead.Below is the code that generates code to capture all parameter values for the proc name you set at the top of the code.DECLARE @proc_name sysnameDECLARE @param_sql nvarchar(max)SET @proc_name = 'dbo.your_proc_name_goes_here'SELECT @param_sql = '--**Begin generated code to capture param values into a string**----------------DECLARE @param_sql nvarchar(max)DECLARE @param_output varchar(8000)DECLARE @param_values varchar(8000)SET @param_values = '''''SELECT @param_sql = ISNULL(@param_sql + '', '') + 'SET @param_sql = ''SELECT @param_output = ISNULL(CAST(' + p.name + ' AS varchar(8000)), ''''NULL'''')''EXEC sp_executesql @param_sql, N''' + p.name + ' ' + t.name + CASE WHEN t.name LIKE '%bin%' OR t.name LIKE '%char%' THEN '(' + CASE WHEN p.max_length = -1 THEN 'MAX' ELSE CAST(p.max_length AS varchar(10)) + ')' END WHEN t.name IN ('datetime2', 'time') THEN '(' + CAST(p.scale AS varchar(3)) + ')' WHEN t.name IN ('decimal', 'numeric') THEN '(' + CAST(p.precision AS varchar(3)) + ', ' + CAST(p.scale AS varchar(3)) + ')' WHEN t.name IN ('float', 'real') THEN '(' + CAST(p.precision AS varchar(3)) + ')' ELSE '' END + ', @param_output varchar(8000) OUTPUT'', ' + p.name + ', @param_output OUTPUTSET @param_values = @param_values + '',' + p.name + '='' + @param_output'FROM sys.parameters pINNER JOIN sys.types t ON t.system_type_id = p.system_type_idWHERE p.object_id = OBJECT_ID(@proc_name)ORDER BY p.parameter_idSET @param_sql = @param_sql + 'SET @param_values = STUFF(@param_values, 1, 1, ''('') + '')''--SELECT @param_values AS param_values--**End generated code to capture param values into a string**----------------'PRINT @param_sql