Link to home
Start Free TrialLog in
Avatar of ukerandi
ukerandiFlag for United Kingdom of Great Britain and Northern Ireland

asked on

T-sql Update Query

Hi I used following t-SQL command to Update name in the TEST_DeliveryAddress  table ,need to take CustAddTest Table name.
But no errors and showing successfully run the query but NOT updating the TEST_DeliveryAddress  Table name field.Any idea what is wrong
Thanks
BEGIN TRY  
  BEGIN TRANSACTION
  UPDATE
    TEST_DeliveryAddress
SET
   name = OT.name
 
FROM
    CustAddTest T
INNER JOIN
    TEST_DeliveryAddress OT
ON
    T.[Customer] = OT. [Cust_Number] AND T.cust_seq=0
    COMMIT
END TRY
BEGIN CATCH

    IF @@TRANCOUNT > 0
        ROLLBACK
END CATCH
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You are updating the TEST_DeliveryAddress.name column with the TEST_DeliveryAddress.name column.  There isn't going to be any  change.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial