Reputation: 895
I want to select some data form another database in another server.
What I know is add a Linked Server, and run the T-SQL.
Is this way is a good choice, or is there any other way to run SQL in other database servers?
thanks.
Upvotes: 3
Views: 1799
Reputation: 107237
How
The upsides
The downsides
Alternatives
But as astander says, there is no real technical issue in accomplishing cross server sql.
Upvotes: 4
Reputation: 166356
Adding a linked server is fine.
You will then probably use the 4 part naming convention
select * from [server].[database].[Owner or Schema].[tablename]
Or you could look at OPENROWSET (Transact-SQL)
Includes all connection information that is required to access remote data from an OLE DB data source. This method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB. For more frequent references to OLE DB data sources, use linked servers instead.
Upvotes: 6