I have two sql database at different PC.how can link b/w
database and database tables.
Answer Posted / meenakshi
we can link database If both the DBs are on same Server and
the current user have access permission on both database
then you can use the following query..
Select SomeColumns From CurrentDBName..TableName
Select SomeColumns From OtherDBName..TableName
If the databases are on different Server then you have to
use the Linked Server..
EXEC sp_addlinkedserver @server = 'SERVER', @provider
= 'SQLOLEDB.1', @srvproduct = '', @provstr
= 'Privider=SQLOLEDB.1;Data Source=TargetServer;Initial
Catalog=Database'
go
Exec sp_addlinkedsrvlogin @rmtsrvname = 'SERVER', @useself
= true, @locallogin = null, @rmtuser = 'Userid',
@rmtpassword = 'Password'
On your SP you can use..
Select * From OpenQuery(MyRemoteServer, 'Select * From
Sysobjects')
--OR
Select * From MyRemoteServer.DatabaseName.dbo.Sysobjects
| Is This Answer Correct ? | 9 Yes | 4 No |
Post New Answer View All Answers
What is unsigned in mysql?
What happens if you no create privilege in a database?
how you will Create a database on the mysql server with unix shell.
What mysql means?
How do I install mysql?
how to take mysql database backup?
How to returns the columns and column information pertaining to the designated table.
How can we convert between Unix & MySQL timestamps?
Can you tell the difference between ereg_replace() and eregi_replace()?
What is a delimiter in mysql?
How do I check mysql version?
Write a command with which mysql table can be repaired
What is an example of a delimiter?
How do I fix a crashed mysql database?
What is mysql port?