Microsoft
Software
Hardware
Network
Question : Create a "Batch Number" in SQL Server 2000 for import of sales orders
Hi all.
We currently have a DTS that imports sales order information in 2 tables:
myHeader and myDetails
myHeader: HeaderID, SalesOrderNumber, Customer, Date
myDetail: DetailID, SalesOrderNumber, Item, Quantity
These get imported once an hour. We have to find a way to treat all the sales orders that are imported every hour as a "batch".
So for example:
Let's say at 9am we have the following sales orders to import:
SO-1, SO-2, SO-3, SO-4 and SO-5 these would be considered Batch 1
At 10am we have the following sales orders to import:
SO-A, SO-B and SO-C these would be considered Batch 2
How can I do this in SQL? I'm thinking I would add another field to myHeader called BatchNo and in my DTS right after I import the header information to myHeader then I will do an UPDATE that will look at records where BatchNo isnull and then get the MAX(BatchNo) + 1.
But when I try doing that in my update statement I get the following error: "An aggregate may not appear in the set list of an UPDATE statement."
Below is my update code
Thank you in advance!
1: 2: 3:
UPDATE myHeader SET BatchNumber = MAX(BatchNumber) + 1 WHERE (BatchNumber IS NULL)
Answer : Create a "Batch Number" in SQL Server 2000 for import of sales orders
Click on Send Receive -> Send Receive Groups -> Define Send Receive Groups (at the bottom and may be what jrathi meant). Send Receive groups dialogue box opens. Send receive interval is in there. ... Thinkpads_User
Random Solutions
Syntax error (missing operator) in query expression
Replacing Keyboard on Toshiba Portege A600
Can windows 7 netbook join an sbs2003 domain?
how to load a php include after page is loaded?
Dynamically Label Radio Button Lists in ASP.net
No Networking Installed on Windows 2008 VM After Migrating From VMWARE Server to ESXi Server
SSRS 2008 Data-Driven Subscription Errors - Email not sent
Is there a way to use visual basic 6 to write data directly to a cd or dvd for windows, xp, vista and 7
iPhone citrix reciever with Citrix Access Gateway
ASP Connection String vs. Database Access DLL