Can any one tell what is wrong with this query. I am trying to update information based on the parameters,I get an message 0 rows effected. However, if I do it manually it works.
-SET @SQL=' UPDATE tblAIAttachments SET Div=' + @Div + 'SET Account =' + @Account + 'WHERE Div=' + @Org_Div + 'AND Account=' + @Org_Account + ' AND Location in(' + @Location + ') ' -- AND UpdateDate >= convert(char(11),@MediaDate,101)
EXECUTE(@SQL)
-SET @SQL=' UPDATE tblAIAttachments SET Div=' + @Div + 'SET Account =' + @Account + 'WHERE Div=' + @Org_Div + 'AND Account=' + @Org_Account + ' AND Location in(' + @Location + ') ' -- AND UpdateDate >= convert(char(11),@MediaDate,101)
EXECUTE(@SQL)