Is there any cross server sql request utility like linqpad?(at least pseudo cross server) or is there any way i can make cross server requests using management studio?
Asked
Active
Viewed 170 times
0
-
1What have you already tried? You might want to Google for `linked servers` as this is probably what you are looking for if you want to execute queries across multiple SQL servers/instances. – 3N1GM4 Dec 04 '16 at 11:59
-
actually i am looking for some utility that will get data from servers based on sql requests and merge it dynamically on my local machine – Grigoryants Artem Dec 04 '16 at 12:04
-
If I needed to do that (as I have many times), I would use SQL Server Management Studio and set up linked servers to allow me to access all of the necessary SQL instances from a single query - is there a reason why this would not work for you and you want to fetch the result set from each SQL server/instance separately and merge on your local machine? – 3N1GM4 Dec 04 '16 at 12:06
-
i guess there is not:) i've googled a bit about linked servers and figured out that its even more suitable for me than i could imagine, thank you! – Grigoryants Artem Dec 04 '16 at 12:17
-
No problem, I've posted an answer below with a little more detail and some example links for you. – 3N1GM4 Dec 04 '16 at 12:20
2 Answers
1
So the answer links to answers that cover 2 out of the myriad of options for doing cross server joins (including local possibilities as per the OPs comment)
- Linked Servers covered by other answer's link
- OpenQuery covered by other answer's link
- OpenDataSource
- OpenRowSet
- SSIS
- Using one of the
Open*
methods to make one server call another, which calls another. - Linqpad can use any C#/Vb/F# code that can get data from multiple servers - not just a single drop down at the top, you don't even have to use that drop down for what you want. see ADO.net
- Composing an
Open*
query via code - SSIS
0
As discussed in the comments, use SQL Server Management Studio and Linked Servers.
Some specific resources here:
Googling for something like SQL Linked Server Query Examples
should uncover everything you need.