|
Prev: How exec a sproc with parms with defaults
Next: Procedure with date range and optional parameters, what's most efficient?
From: Jack on 18 Jul 2008 18:50 DECLARE @TranName VARCHAR(20) SELECT @TranName = 'MyTransaction' BEGIN TRANSACTION @TranName GO USE ts2_aldkt_app GO update tblcustomer set sales_ytd = (sales_ytd + 10000) set sales_lstyr = (sales_lstyr + 10000) GO COMMIT TRANSACTION MyTransaction GO I am getting the following error: Line 1: Incorrect syntax near '='. Any help is appreciated
From: Plamen Ratchev on 18 Jul 2008 19:03
Your update statement has two SET clauses, it has to be only one: UPDATE tblcustomer SET sales_ytd = (sales_ytd + 10000), sales_lstyr = (sales_lstyr + 10000); HTH, Plamen Ratchev http://www.SQLStudio.com |