SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

SQL 2008 MERGE using Dynamic SQL over a Linked Server

By Tommy Bollhofer, 2009/04/30

Total article views: 602 | Views in the last 30 days: 38

Yet another reason to upgrade to 2008; MERGE. I wrote this for a BI project I was working on recently.. This SP is self explanatory. It Uses dynamic SQL to build a MERGE statement over a linked server with some additional parameters; i.e. Oracle vs. SQL, limit the source data, etc.

I'm using this in combination with SSIS as part of an ETL task. i.e. use a data flow task to interate through the sys.tables in a given schema and put the table names into an ADO recordset object, then execute this SP using an expression inside a for each loop container.

Enjoy! (just give me some credit if you use it :)-)

By Tommy Bollhofer, 2009/04/30

Total article views: 602 | Views in the last 30 days: 38
Your response
 
 
Related tags

Data Warehousing     SQL Server 2008    
MERGE     T-SQL    
 
 
Contribute
Like this? Try these...

Move one Filegroup to another

By Tobias Kiemes | Category: FileGroup
(not yet rated) | 406 reads

Free registration required...

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Login (existing users)

Login

Email:   Password:   Remember me: Forgotten your password?

Register (new users)

Register

Email:   Password:
Confirm:

Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

Steve Jones
Editor, SQLServerCentral.com