Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
T-SQL (SS2K8)
»
Merge Statement over a linked server
14 posts, Page 1 of 2
1
2
»»
Merge Statement over a linked server
Rate Topic
Display Mode
Topic Options
Author
Message
cgauntlett
cgauntlett
Posted Saturday, November 24, 2012 3:42 PM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 1:10 PM
Points: 3,
Visits: 80
Does anyone know a way of running a MERGE statement across 2 tables over a linked server?
Getting the message "The target of a MERGE statement cannot be a remote table, a remote view, or a view over remote tables."
Post #1388342
Vedran Kesegic
Vedran Kesegic
Posted Saturday, November 24, 2012 6:08 PM
Old Hand
Group: General Forum Members
Last Login: 2 days ago @ 6:00 PM
Points: 343,
Visits: 1,077
Try executing the whole statement at destination db:
EXEC('MERGE ...') AT MYDBLINKNAME
What is remote server? Sql server, oracle or something else?
_____________________________________________________
XDetails Addin
- for SQL Developers and DBA
blog.sqlxdetails.com
- Transaction log myths - debunked!
Post #1388351
cgauntlett
cgauntlett
Posted Sunday, November 25, 2012 6:00 AM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 1:10 PM
Points: 3,
Visits: 80
Thanks for the suggestion, i'll give it a try.
This is SQL 2008R2 setup I'm trying to run it on.
Post #1388392
cgauntlett
cgauntlett
Posted Monday, November 26, 2012 1:45 PM
Forum Newbie
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 1:10 PM
Points: 3,
Visits: 80
Tried it yesterday and it worked perfectly. Thanks again.
Post #1388827
Vedran Kesegic
Vedran Kesegic
Posted Monday, November 26, 2012 3:57 PM
Old Hand
Group: General Forum Members
Last Login: 2 days ago @ 6:00 PM
Points: 343,
Visits: 1,077
You're welcome!
_____________________________________________________
XDetails Addin
- for SQL Developers and DBA
blog.sqlxdetails.com
- Transaction log myths - debunked!
Post #1388884
girl_bj0619
girl_bj0619
Posted Tuesday, April 23, 2013 8:51 AM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, May 16, 2013 1:55 AM
Points: 8,
Visits: 30
how does the query works?
Post #1445491
Phil Parkin
Phil Parkin
Posted Tuesday, April 23, 2013 8:57 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: 2 days ago @ 9:39 AM
Points: 4,247,
Visits: 9,500
girl_bj0619 (4/23/2013)
how does the query works?
Execute At [linked_server]
causes the statement to be executed on the linked server (not on the server running the EXECUTE statement). Is that what you mean?
--Edit: fix typo
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
Post #1445493
girl_bj0619
girl_bj0619
Posted Tuesday, April 23, 2013 10:40 AM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, May 16, 2013 1:55 AM
Points: 8,
Visits: 30
i meant where to apply it?
here..?
merge ...
using....
Post #1445570
Phil Parkin
Phil Parkin
Posted Tuesday, April 23, 2013 10:48 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: 2 days ago @ 9:39 AM
Points: 4,247,
Visits: 9,500
girl_bj0619 (4/23/2013)
i meant where to apply it?
here..?
merge ...
using....
Can you take a bit more time to write out what you are trying to do please, because I do not understand your question?
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
Post #1445575
Sean Lange
Sean Lange
Posted Tuesday, April 23, 2013 11:16 AM
SSCrazy Eights
Group: General Forum Members
Last Login: 2 days ago @ 1:17 PM
Points: 8,641,
Visits: 8,273
I think you are asking where do you run the MERGE???
EXEC('Your Entire MERGE Statement goes here') at LinkServer
_______________________________________________________________
Need help? Help us help you.
Read the article at
http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Moden's
splitter
.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Post #1445592
« Prev Topic
|
Next Topic »
14 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.