Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linked Server In SQL Server Express

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.

like image 807
JSJ Avatar asked Nov 12 '10 06:11

JSJ


1 Answers

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
like image 129
Saif Khan Avatar answered Oct 03 '22 14:10

Saif Khan