Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Insert new data with a timestamp?

Author  Topic 

ostinoh
Yak Posting Veteran

66 Posts

Posted - 2011-10-28 : 13:30:02
Hello -

I‘m currently building an SSIS package to pull data from one db table and insert it into another db table on a different server. Then our users can use excel to connect and pull that data down to pivot how they like.

My current script looks like this.

SELECT *
FROM hgvBacklogLabor_Changepoint where Week between dateadd(dd,0,datediff(dd,0,(dateadd(dd,(datepart(dw, getdate())*-1 ),getdate())))) and dateadd(ww, 62, dateadd(dd,0,datediff(dd,0,(dateadd(dd,(datepart(dw, getdate())*-1 ),getdate())))))

What I need help with how can I keep historical data for example last week’s data and insert new data every time with a timestamp.

Thanks in advance for any insight into this.
David

X002548
Not Just a Number

15586 Posts

Posted - 2011-10-28 : 13:35:57
you need a batch window table that describes when you last closed the window..if I'm getting this right..

But why do you need to use SSIS?

Personally, I would bcp out the Data using query out and bcp the data in



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-10-28 : 13:36:13
but I'm a Dinosaur

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -