Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is unsigned in mysql?

938


What happens if you no create privilege in a database?

1119


how you will Create a database on the mysql server with unix shell.

1051


What mysql means?

944


How do I install mysql?

913


how to take mysql database backup?

1074


How to returns the columns and column information pertaining to the designated table.

1022


How can we convert between Unix & MySQL timestamps?

967


Can you tell the difference between ereg_replace() and eregi_replace()?

1037


What is a delimiter in mysql?

1034


How do I check mysql version?

1047


Write a command with which mysql table can be repaired

947


What is an example of a delimiter?

933


How do I fix a crashed mysql database?

962


What is mysql port?

1060