Connecting Tech Pros Worldwide Help | Site Map

Sql insert cursor

  #1  
Old May 12th, 2009, 07:27 AM
Newbie
 
Join Date: Apr 2009
Location: Okinawa
Posts: 7
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.CustomerOrder 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
  #2  
Old May 12th, 2009, 08:55 PM
iburyak's Avatar
Expert
 
Join Date: Nov 2006
Posts: 1,017

re: Sql insert cursor


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?
  #3  
Old May 13th, 2009, 05:39 AM
Newbie
 
Join Date: Apr 2009
Location: Okinawa
Posts: 7

re: Sql insert cursor


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

-Gabe
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with MySQL cursor Florian Lindner answers 2 October 12th, 2007 07:55 PM
PL/SQL-CURSOR - 2 debasisdas insights 0 May 28th, 2007 02:17 PM
insert a dictionary into sql data base David Bear answers 7 December 6th, 2005 10:35 PM
Problem With Insert with MySQLdb David Mitchell answers 3 November 1st, 2005 11:15 AM