I want to port data from one server's database to another server's database. The databases are both on a different mssql 2005 server. Replication is probably not an option since the destination database is generated from scratch on a [time interval] basis.
Preferebly I would do something like
insert * from db1/table1 into db2/table2 where rule1 = true
It's obvious that connection credentials would go in somehwere in this script.
There are 2 steps to join tables from different servers. The first step is to link the SQL Servers. The next and the last step is to join the tables using the select query having the server name as prefix for the table name.
It's not just the cross-platform expansion which is new in 2017. New features have also been added to the platform. It should be noted that Microsoft has continued its cloud-first approach. Many of the new features in SQL Server 2017 have been available in Azure SQL.
Example. This example illustrates a method to transfer data from one database into a memory-optimized table in a different database. Create Test Objects. Execute the following Transact-SQL in SQL Server Management Studio.
I think what you want to do is create a linked server as per this msdn article. You would then select using a 4 part object name eg:
Select * From ServerName.DbName.SchemaName.TableName
You can use Open Data Source Like this :
EXEC sp_configure 'show advanced options', 1 GO RECONFIGURE GO EXEC sp_configure 'Ad Hoc Distributed Queries', 1 GO RECONFIGURE GO SELECT * FROM OPENDATASOURCE('SQLOLEDB', 'Data Source=<Ip Of Your Server>; User ID=<SQL User Name>;Password=<SQL password>').<DataBase name>.<SchemaName>.<Table Or View Name> Go
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With