We help IT Professionals succeed at work.
Get Started

T-sql Update Query

150 Views
Last Modified: 2015-09-09
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
Comment
Watch Question
Senior .Net Developer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 2 Answers and 3 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE