You now need to access another two databases (NZ and AU) from another server (B) in the database (Master) on a single server (a). AU and NZ are part of the site's real-time data, and the current replication scheme for one step is basically consistent with master data structures from Server B to A,au/nz.
As a result, when the AU Replication to master, in the NZ Replication to master, master, only the number of NZ data left. In turn, only the AU, the specific replication is how the matter, I do not understand, also did not scrutinize.
It would be nice if you could directly operate AU and NZ in master.
SQLServer has functions:
OPENROWSET and OpenDataSource
These two functions not only enable reading of data from another database, but also read data from Excel, TXT, ORACLE, ODBC, and so on.
--Enable the ad Hoc distributed Queries:
exec sp_configure ' show advanced options ', 1
Reconfigure
exec sp_configure ' Ad Hoc distributed Queries ', 1
Reconfigure
SELECT *
From OpenDataSource (
'
SQLOLE DB ',
' Data source=
SQLServerName; User Id=sa; Password=xxx '
). Help.dbo.Help_Category
Or
SELECT * FROM OPENROWSET ('
SQLOLE DB ', '
SQLServerName '; ' Sa '; ' xxx ', Help.dbo.Help_Category)
--Close the ad Hoc distributed Queries:
exec sp_configure ' Ad Hoc distributed Queries ', 0
Reconfigure
exec sp_configure ' show advanced options ', 0
Reconfigure
However, this writing is a bit complicated, and not easy to maintain, if the database password changed, you need to put a password to correct.
Oracle has DB Link, and the syntax is very concise.
Check the Help,
SQLServer has "linked server" this dongdong. To create a linked server you need to use
SQLA system stored procedure for Server:
sp_addlinkedserver [@server =] ' server ' [, [@srvproduct =] ' product_name ']
[, [@provider =] ' provider_name ']
[, [@datasrc =] ' data_source ']
[, [@location =] ' location ']
[, [@provstr =] ' provider_string ']
[, [@catalog =] ' catalog ']
exec sp_addlinkedserver @server = ' xling ', @srvproduct = ', @provider = '
SQLNcli ', @datasrc = '
SQLServerName2 '
After execution, you can see this xling in the server object-"link Server" in the Object Explorer of SQL Server Management Studio
Then you can use:
SELECT * from Xling. PricemeHelp.dbo.Help_Category
The xling here is pointing to the database
SQLServerName2 's linked server, as you can see from the select above, is still complex to write.
SQLThe Server also has, and the syntax is similar:
CREATE synonym dbo. Help_category_nz for xling. PricemeHelp.dbo.Help_Category
After execution, you can use:
SELECT * from Help_category_nz
Out!