Linked Server In SQL Server Express

2019-04-07 08:25发布

问题:

I am developing an app where i have a local database in SQL Server Express. During work in local database, we need to execute a query on another SQL Server / live server and its return a value and with this value we execute a query in local server.

It is OK when executing this query against 2 or 3 queries, but i have around 5000 records on which I need to execute same process. I have done with above style but its take too much time.

I've found that we can run a query on multiple servers.

Can i run a query on SQL Server Express and server at same time and and run my whole queries in this style?

I can run query from express to server only.

回答1:

Yes you can. Setup the LinkServer on the SQL Express then just pass your query in the four part name format

server . database . schema . object

example

select * from LinkServer.mydatabase.dbo.Table