I will change the code like what you had said but when it was having issues with the Test_Code Column in the Table_Test1 . It should throw an error message like it cannot convert 1000 to 1001 but why was it throwing an error message like the one mentioned below.
Conversion failed when converting the varchar value '2314K' to data type int. [SQLSTATE 22018] (Error 245).
Because you used this
update Table_Test1 set Test_Code=1001 where Test_Code=1000
instead of this
update Table_Test1 set Test_Code='1001' where Test_Code='1000'
Your version forces SQL Server to attempt to convert the column to an INT in order to compare it with 1000. Version 2 uses the literal text.
Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this
If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.