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 2005 Forums
 Transact-SQL (2005)
 Update Data

Author  Topic 

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2009-01-09 : 03:56:46
I currently have an update that gets my data for yesterday from my telecoms server. Over the christmas break the telecoms server did not run at the right time so I am missing some data. As my final export of this data is not live as of yet I was able to nottice this error is there any code I can use to check my data if the date exsists and if not update my table and if it does check the next date.

Many Thanks



Whitmoj
If you are in a hurry you will never get there

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-09 : 04:21:49
See http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-09 : 04:59:47
[code]INSERT INTO DestTable
SELECT * FROm SourceTable s
WHERE NOT EXISTS(SELECT 1 FROM DestTable WHERE Date=s.date
[/code]
Go to Top of Page
   

- Advertisement -