Sql insert cursor

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GabeM
    New Member
    • Apr 2009
    • 7

    Sql insert cursor

    Here is my situation that I am presenting.

    I have a table "WebOrders" that is located in a database called SC and I want to insert the data into another table called CustomerOrder located in a database called SMS. The WebOrders must be inserted into the SMS.CustomerOrd er table but incremented starting by the last entry in a column called Order_No. Order_No is in the following format GSA7667 NVARCHAR(10). How can I do this with a cursor?

    TIA -Gabe
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    Can you order by date in descending order instead of ID??
    Try to use cursors as little as possible you can insert whole table in one shot why would you use cursor for that?

    Comment

    • GabeM
      New Member
      • Apr 2009
      • 7

      #3
      Iburyak, I think I got a solution. Thank you for replying!

      -Gabe

      Comment

      Working...