SQL Clone
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
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1833 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 (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 26
why not use replication ?
patrickmcginnis59
patrickmcginnis59
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1569 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 (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 26
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
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1569 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
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2201 Visits: 4369
why not use POSH (Powershell) ?

easy, convenient and efficient :-D

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

Group: General Forum Members
Points: 2898 Visits: 878
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
SSC Rookie
SSC Rookie (43 reputation)SSC Rookie (43 reputation)SSC Rookie (43 reputation)SSC Rookie (43 reputation)SSC Rookie (43 reputation)SSC Rookie (43 reputation)SSC Rookie (43 reputation)SSC Rookie (43 reputation)

Group: General Forum Members
Points: 43 Visits: 615
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
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22558 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