Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Select,Update,Delete,Insert etc.. in many server using 1 query


Select,Update,Delete,Insert etc.. in many server using 1 query

Author
Message
Lester Policarpio
Lester Policarpio
SSC-Addicted
SSC-Addicted (407 reputation)SSC-Addicted (407 reputation)SSC-Addicted (407 reputation)SSC-Addicted (407 reputation)SSC-Addicted (407 reputation)SSC-Addicted (407 reputation)SSC-Addicted (407 reputation)SSC-Addicted (407 reputation)

Group: General Forum Members
Points: 407 Visits: 2459
Comments posted to this topic are about the item Select,Update,Delete,Insert etc.. in many server using 1 query

"-=Still Learning=-"

Lester Policarpio
A Point - Daniel
A Point - Daniel
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 25
why not use replication ?
patrickmcginnis59
patrickmcginnis59
SSC-Addicted
SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)

Group: General Forum Members
Points: 431 Visits: 2333
daniel 40017 (3/28/2012)
why not use replication ?


So how would you set up replication to send a one time query to my 50 linked servers? It must be a short efficient procedure since its a one off job.
A Point - Daniel
A Point - Daniel
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 25
The issue you presented regards an insert operation.
a query is a different thing - one might think you are referring to distributed query on multiple servers for performance.

an insert operation is generally not a one time operation and if you are adding records to a table and need to insert the same records to 50 other db's than I would use replication on that table and replicate it to all other servers. you have a built in module in sql server that does the work - why develop it yourself ?
patrickmcginnis59
patrickmcginnis59
SSC-Addicted
SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)SSC-Addicted (431 reputation)

Group: General Forum Members
Points: 431 Visits: 2333
daniel 40017 (3/28/2012)
The issue you presented regards an insert operation.
a query is a different thing - one might think you are referring to distributed query on multiple servers for performance.

an insert operation is generally not a one time operation and if you are adding records to a table and need to insert the same records to 50 other db's than I would use replication on that table and replicate it to all other servers. you have a built in module in sql server that does the work - why develop it yourself ?

I think it was a pretty handy little concept (I wasn't the original author), I'll probably play with his script a bit. It would be useful in my situation because I do have multiple servers, and while I may insert values into many tables on many servers, I wouldn't want the complete contents of tables replicated, and I'd also do select queries.
SQLQuest29
SQLQuest29
Right there with Babe
Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)

Group: General Forum Members
Points: 746 Visits: 4310
why not use POSH (Powershell) ?

easy, convenient and efficient :-D

______________________________________________________________________________________________________________________________________________________________________________________
HTH !
Kin
MCTS : 2005, 2008
Active SQL Server Community Contributor :-)
shaun.stuart
shaun.stuart
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1998 Visits: 846
Or, if you have all the servers in a server group in SSMS, just open a multi-server query window in SSMS and run the query once against all the servers. http://shaunjstuart.com/archive/2011/09/teaching-an-old-dog-new-tricks/
Derek Wharton
Derek Wharton
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 606
shaun.stuart (3/28/2012)
Or, if you have all the servers in a server group in SSMS, just open a multi-server query window in SSMS and run the query once against all the servers. http://shaunjstuart.com/archive/2011/09/teaching-an-old-dog-new-tricks/


This was my first thought.:-)
Iwas Bornready
Iwas Bornready
SSCrazy Eights
SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)SSCrazy Eights (8.7K reputation)

Group: General Forum Members
Points: 8654 Visits: 885
Thanks for the script.
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