April 4, 2005 at 11:01 am
I'm using this query to archive Event Data from an EVENTS Table older than two weeks as the source for a Transform Data Task in DTS . Here's the query.
SELECT *
FROM events
WHERE DATEDIFF(DAY, EVENT_DATE, getdate()) > 14
I want to insert these records into an identical archive table, but let the ID Column in the Archive table increment on its own. Is there a way to do this with a Data Transform task or do I need to use an INSERT Statement to do this and just leave the ID Column blank?
April 4, 2005 at 11:31 am
Put all the columns that you need to transfer in the insert and select list omitting the primary key.
Insert into ArchiveTable (Col1, Col2, ColN)
Select Col1, Col2, Coln From dbo.Events where DATEDIFF(DAY, EVENT_DATE, getdate()) > 14
April 4, 2005 at 11:50 am
Thanks for the reply. I found this other solution to my problem in case anyone else needs it.
Pat
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply