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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Optimize loading of data

Author  Topic 

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2011-10-05 : 05:36:58
Hi,

I have the following information:

AccNum, StatementDate, Amount, etc etc etc

This is a big query which is then loaded into a staging table, my goal is to reduce the load time, as I want to avoid loading the entire data everytime and only processing what I havent loaded already.

Is there a way I can use the statementdate and run my SP to look at the last statement date and load based on that?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-05 : 05:42:09
yep. you can use MERGE statement for this based on statementdate

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2011-10-05 : 06:16:59
hi

Any chance you can show me an example? Im quite new to merge

Thanks :)

quote:
Originally posted by visakh16

yep. you can use MERGE statement for this based on statementdate

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/



Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-05 : 06:26:44
see

http://technet.microsoft.com/en-us/library/bb510625.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -