ankouny
asked on
Select Statement between different servers?
Hello Guys,
Is there anyway I can select data from a database that is in server 1 and insert it into a database in server 2 ?
Thanks
Is there anyway I can select data from a database that is in server 1 and insert it into a database in server 2 ?
Thanks
u can use linked server option
SQL Server has a few mechanisms to reach out to another server (even another server type) and query data from within a Transact-SQL statement. Among them are a set of stored credentials and information (called a Linked Server), a statement that uses a linked server called called OPENQUERY, another called OPENROWSET, and one called OPENDATASOURCE.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ankouny,
If you want to fetch the data from another server in a ad-hoc manner or one time, then you can go with OPENDATASOURCE query provided in my earlier comment.
If you want to do this is in a regular manner and periodically, then you can create a Linked Server ( provided you have appropriate privileges) and fetch records appropriately.
If you want to fetch the data from another server in a ad-hoc manner or one time, then you can go with OPENDATASOURCE query provided in my earlier comment.
If you want to do this is in a regular manner and periodically, then you can create a Linked Server ( provided you have appropriate privileges) and fetch records appropriately.
PatelAlpesh,
>> Yes, you can do it, if the servers are linked.
You can also do it without creating a Linked Server using OPENDATASOURCE as I mentioned above..
>> Yes, you can do it, if the servers are linked.
You can also do it without creating a Linked Server using OPENDATASOURCE as I mentioned above..
tehn import in new database