dbTalk Databases Forums  

ETL load getdate()

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss ETL load getdate() in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
baaul
 
Posts: n/a

Default ETL load getdate() - 09-25-2004 , 03:59 PM






I need any script suggestion to use in my stored_procedure_load. Looking to
load only the new data into staging tables since last_load_date.
I wish to enter the last_load_date information into a table on each
succesful load...and use the last_load_date info. in my query.

eg.
SELECT a,b,c,d
FROM dbo.customer WHERE
BETWEEN last_load_date AND getdate()



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: ETL load getdate() - 09-26-2004 , 02:12 AM






Store the load dates in a seperate table. At the end of the load you can
enter the new load date into this table. In your query to decide which data
to take you can do


SELECT .....................
FROM ...................
WHERE DataDate Getween Getdate() AND (SELECT MAX(Load_Date) FROM LoadTable)



--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"baaul" <baaul (AT) discussions (DOT) microsoft.com> wrote

Quote:
I need any script suggestion to use in my stored_procedure_load. Looking
to
load only the new data into staging tables since last_load_date.
I wish to enter the last_load_date information into a table on each
succesful load...and use the last_load_date info. in my query.

eg.
SELECT a,b,c,d
FROM dbo.customer WHERE
BETWEEN last_load_date AND getdate()





Reply With Quote
  #3  
Old   
dwh2200
 
Posts: n/a

Default Re: ETL load getdate() - 09-28-2004 , 02:35 PM



Your second option is to add an execute sql task in front of the load that
captues the max date already in your destination table. Plug that into a
global variable and pass it to the next step in your package. Same result
without the extra table.

"Allan Mitchell" wrote:

Quote:
Store the load dates in a seperate table. At the end of the load you can
enter the new load date into this table. In your query to decide which data
to take you can do


SELECT .....................
FROM ...................
WHERE DataDate Getween Getdate() AND (SELECT MAX(Load_Date) FROM LoadTable)



--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"baaul" <baaul (AT) discussions (DOT) microsoft.com> wrote in message
news:251E316E-8A30-4E40-BFDB-1A7B94E476F4 (AT) microsoft (DOT) com...
I need any script suggestion to use in my stored_procedure_load. Looking
to
load only the new data into staging tables since last_load_date.
I wish to enter the last_load_date information into a table on each
succesful load...and use the last_load_date info. in my query.

eg.
SELECT a,b,c,d
FROM dbo.customer WHERE
BETWEEN last_load_date AND getdate()






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.