Robert Rawlins - Think Blue wrote:
> 
> GF:34:00:3F:FD, 6, 1, 2007-01-01 13:00:00, 1
> GF:34:00:3F:FD, 6, 2, 2007-01-01 13:01:00, 1
> GF:34:00:3F:FD, 6, 1, 2007-01-01 13:04:00, 1
> GF:34:00:3F:FD, 6, 4, 2007-01-01 13:08:00, 1

> create procedure usp_Something AS
> BULK INSERT YourStagingTable
> FROM 'c:\YourInputFile.txt'
> 
> INSERT INTO TableWithMacAddresses
> SELECT MacAddress, Port
> FROM YourStagingTable
> WHERE MaxAddress NOT IN (SELECT MacAddress FROM TableWithMacAddresses)

You really want a DISTINCT here.


> INSERT INTO TableWithLoggingData
> SELECT {Your Columns}
> FROM YourStagingTable
> 
> GO

INSERT INTO TableWithLoggingData (x, y, z)
SELECT TWMA.PK, YST.y, YST.z
FROM YourStagingTable YST INNER JOIN TableWithMacAddresses TWMA ON 
YST.MacAddress = TWMA.MacAddress

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275997
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to