SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Merge, Metadata and the Data Mart ETL


Merge, Metadata and the Data Mart ETL

Author
Message
chris.ross 34852
chris.ross 34852
Valued Member
Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)

Group: General Forum Members
Points: 67 Visits: 99
Comments posted to this topic are about the item Merge, Metadata and the Data Mart ETL
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)

Group: General Forum Members
Points: 80008 Visits: 13301
There's a MERGE statement in SQL Server 2005? ;-)


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Krtyknm
Krtyknm
Old Hand
Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)

Group: General Forum Members
Points: 392 Visits: 374
I don't think MERGE statement is available in SQL Server 2005. Hope it should read SQL Server 2008.
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)

Group: General Forum Members
Points: 80008 Visits: 13301
Krtyknm (12/27/2012)
I don't think MERGE statement is available in SQL Server 2005. Hope it should read SQL Server 2008.


It isn't. Hence the smiley ;-)


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
benji41414 5900
benji41414 5900
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 11
Hello,

With SQL code, you use database ressource instead of server ressource it's not really "clean"
nick.kaye
nick.kaye
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 53
A minor typo (?) - Your create table has your dreaded underscore (Object_ID), but your primary key doesn't (ObjectID).
chris.ross 34852
chris.ross 34852
Valued Member
Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)

Group: General Forum Members
Points: 67 Visits: 99
Yeah that's a potential negative of the method. But I find significant performance benefits with all of it happening in the database as only rows that have changed need to be touched which in some cases outweighs the need to be 'clean'. Other methods require all data be moved or complex incremental logic created or SSIS used and there's pros and cons to each. This is just a way to do it all in SQL.
chris.ross 34852
chris.ross 34852
Valued Member
Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)Valued Member (67 reputation)

Group: General Forum Members
Points: 67 Visits: 99
My mistake, SQL 2005 should be 2008. Thanks for correcting! Also, I use Object_ID only to match the SQL system tables, in all other places I don't use _'s because they're annoying Smile

Thanks for the feedback
baclanov
baclanov
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 Visits: 54
Use:
WHEN MATCHED AND '+REPLACE(REPLACE(C.UpdateColumns,'=',''),',',' OR ')+'


Result:
Tgt.[DateID]Src.[DateID] OR Tgt.[ProductID]Src.[ProductID] OR ...



I think here the sign '<>' is omitted?

h.e. Tgt.[DateID]<>Src.[DateID] OR Tgt.[ProductID]<>Src.[ProductID] OR ...
Krtyknm
Krtyknm
Old Hand
Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)Old Hand (392 reputation)

Group: General Forum Members
Points: 392 Visits: 374
@Koen Verbeeck

Yeah!! Got it;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search