But it work if i send the parameters as specific values.
But it work if i send the parameters as specific values.
Try creating your inputs and query string as variables and then execute the Query variable. Something similar to this:
DECLARE @Input1 int DECLARE @Input2 nvarchar(75) DECLARE @sqlCommand nvarchar(1000) SET @Input1 = ? SET @Input2 = ? SET @sqlCommand = '[dbo].[Yearly_Serial_Number] @SubmissionID=' +@Input1 + ' , @CreatorUser=' + @Input2 + ';' EXEC (@sqlCommand)
Note that in the @sqlCommand, you may have to add the quotations around your @Input2 (after the "=" and before the ";") to make it execute properly. To include a quote(') in a nvarchar, you must "escape" it by repeating it (2 quotes in a row includes 1 quote in the nvarchar).
@CreatorUser=''' + @Input2 + ''';'
Your syntax can't include named parameters for ODBC because does not support named parameters.
(the order of the values should match the order the procedure expects the parameters in)