I have an issue with the following:
-- the following is working
INSERT INTO Z_ToolLog
(Tool, Unit, Run, ProcessSendDate, ProcessTime, Recipe, Action, Remark, UserName, L1, L2,
L3, L4, LogDate, EntryDate)
VALUES
(@t14, @t8, @t7, @t9, @t10, @t11, @t12, @t13, @t6, @T0,@t1, @t2,@t3,@t5,@t15)
**the following is NOT working with error: **
conversion Failed when converting nvarchar value 'INSERT INTO Z_ToolLog (Tool, Unit, Run, ProcessSendDate, ProcessTime, Recipe, Action, Remark, UserName, L1, L2, L3, L4, LogDate, EntryDate) VALUES ('CVD',' to data type int
SET @SQL = CASE
WHEN @Exe = 2
THEN 'Print 1'
ELSE '
INSERT INTO Z_ToolLog
(Tool, Unit, Run, ProcessSendDate, ProcessTime, Recipe, Action, Remark, UserName, L1,
L2, L3, L4, LogDate, EntryDate)
VALUES
(''' + @t14 + ''',
' + @t8 +',
' + @t7+',
' + @t9+',
'+ @t10+',
'''+ @t11+''',
'''+ @t12+''',
'''+ @t13+''',
'''+ @t6+''',
'''+ @T0+''',
'''+@t1+''',
'''+ @t2+''',
'''+@t3+''',
' +@t5+',
' +@t15+')'
END;
EXEC @SQL;
not sure why the error, double-check the definitions of the parameters and the table setting
Does anyone have an idea?
Thanks, Avner