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
Windows 2008 server froze. Log files display schannel error.
Send two files in email as attachment in unix shell scripting using ksh
jquery validator and asp.net updatepanel
make hfsplus partition writable on ubuntu
Help needed to install Team Foundation Server 2010
Error Loading Operating System
Suitable Backup Solution requested
When I can #import a dll and when must I #import a tlb?
How to get IP Address along with hostname in SQL server 2008
Juniper DMZ configuration