I have a stored procedure that is throwing an error on an UPDATE command here are the pertinent lines of code.
DECLARE @submitDate1 DATETIME;
SET @submitDate1 = GETDATE()
SET @sql = 'UPDATE ' + @currTable + ' SET [lang_String] = ''' + @lang_String + ''', [date_Changed] = ''' + @submitDate1 + ''', [prev_LangString] = ''' + @prev_LangString + ''', [needsTranslation] = ''' + @needsTranslation + ''' WHERE [ID] = ' + CAST(@ID as nvarchar(10)) + '; '
EXEC(@sql)
Here is the error…
Conversion failed when converting date and/or time from character string.
You have to convert the date into a string before concatenating it to the other strings: