SQL Backup Pro
Getting started with SSIS - Part 1: Introduction to SSIS
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.
Loading

Ask in the public forum

Ask your questions in a public forum

My Blog Posts

SQL Server Monitoring
  • Alternate Method to Update a Table without UPDATE Statement

    Hi Jacob

    Greetings!!!

    I have multiple update statements like below in stored procedures.

    UPDATE T3 SET PID = S2.PID
    FROM S1, S2
    WHERE S1.PID = S2.PID
    AND S2.PID IN ('ABC','RFZ')

    The stored procedure execution takes 43 mins.

    Do we have any alternate method to update a table without using UPDATE statement?

    Could you please suggest me any such possibility.

     

    Note: I am working on SQL Server 2005.

     

    Best Regards

    Sunny

     

     

     

    sunny.msbi
    1186 · 0% · 9

2  Replies  

Subscribe to Notifications
  • Hi Sunny

    The UPDATE statement is the only statement that you can use for updating existing values on a table. So there is no alternative. I understand that your problem is not with the UPDATE statement, but with the delay it takes to complete the execution.

    Do you have a PK/FK relationship between the tables? It is difficult to say what is causing the delay without looking at the details. Can you post the schema of those two tables? Also, if you can take the execution plan in text format and post, will be helpful.

    Jacob Sebastian
    1 · 100% · 16868
  • Also how do you relate T3 with other tables? I dont see any relations. If you properly relate, it can speed up the query

    Can you post the table structures ?

    Madhivanan
    3 · 34% · 5789

Your Reply


Sign Up or Login to post an answer.

Managed Windows Shared Hosting by OrcsWeb

Copyright © Beyondrelational.com