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
Could not reliably determine the server's fully qualified when trying to restart https service
SSIS and variable issues
How to configure SSG-140 with multiply public IP's on single interface.
Game Development - Story Boarding a Game
sharepoint foundation 2010 on 32 bit?
How do I get the selected value from WPF combobox
ABAP syntax error:statement is not accessible
Wake on LAN almost never works.
I can not print to tray two which has legal size paper in it. The printer is a HP 3005 pcl printer and there are other users that can print to this tray when printing legal documents.
Columns cannot convert between unicode and non-unicode string data types.