Today the project manager came running to yell at me and say what I did before I made a lot of interfaces why didn't do it, I directly fire, before obviously not this thing ...
But things still have to be solved, but fortunately, two projects are all used SQL Server, you can quickly solve the problem by cross-database view, save a lot of work. How to do it? Let's see below.
text :
Sometimes we have access to other SQL Server databases, which we can do with a view using
OpenDataSource (supported by SQL Server 2000 or later). For example:
Create VIEW [dbo]. [Vtablename]
Asselect * from opendatasource ( ' SQLOLEDB ', ' Pwd=loginpassword; Uid=otherserveruserid;initial Catalog=databasename; Server=dataserver '). Databasename.dbo. [TableName] Go accesses another database server in the identity of the UID and PWD.
where :
PWD : Refers to another database server login password
UID : Refers to another database server login ID (user name)
Initial Catalog : Indicates the database
Server: Indicates that we can read the data in the following ways: Select * from [dbo]. [Vtablename]
Ways to access another database server table through SQL Server view