I have this huge stored procedure where I am building a sql statement. At the end, I create a parameter list like this:
DOES @paramList need and N in front of it??
SELECT @paramList = '@param1 nvarchar(300),
@param2 nvarchar(10),
@param3 nvarchar(10),
@param4 nvarchar(100),
@param5 nvarchar(1000),
@param6 nvarchar(1000),
@param7 nvarchar(200),
@param8 nvarchar(2000)’
I am then calling sp_executesql like this:
EXEC sp_executesql @sql, @paramList,
@param1,@param2,@param3,@param4,
@param5,@param6,@param7,@param8
where @sql is the statement, paramList is my parameter list and all the other variables are the parameters I declared at the top of the stored procedure. Is this the correct way to do it?