Do the project, do not know whether people have this problem, the local SQL is version 2005, but the server is version 2008, but need to link to view the data is not linked to. What about this time?
Well done! To do a few can be done in the sql2005 of the sql2008 data to be deleted and removed.
The first step: Log on locally on the sql2005. (Simple bar)
Step Two: Create a new query. (It's easy too)
Step three: In the new query, enter:
--Represents the creation of a remote linked object
EXEC sp_addlinkedserver
' Exam ',--remote server object name
‘‘,
' SQLOLEDB ',
' 192.168.1.*** '--the server IP that needs to be linked
sp_addlinkedsrvlogin
' Exam ',
' False ',
Null
' sa ',--database account
' Sasa '--Database password
After execution, assuming that you access the table Table1 of the database testdata on the target server, you can enter in a new local query: SELECT * from exam. TestData.dbo.Table1. You can query the data in the sql2008 database.
One problem to note here is that the method is not valid for stored procedures, and because the stored procedure calls a syntax constraint, the object name cannot be added to the stored procedure. No major cases have been identified for the time being. I hope you will forgive me.
Database Script link Remote server