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 the use of mysqli_query?
How do you rename a procedure in mysql?
How do I create a schema in mysql?
Hi Team, This is kartik, I recently completed my B-tech. Importance of posting this question is for to know the best books on SQL(MYSQL/Oracle)? I like SQL concept's so much, at the same time i decided to choose SQL for my career purpose. So please suggest me the best books that are very helpful for a fresher to improve concepts like (SQL/PLSQL)Basics, programming concepts, architectures etc. Please consider my request as an important one. I am very thankful to you for providing this opportunity. If possible can you please send the names of books for my personal id also: karthikgdv1206@yahoo.com. Thanks, Kartik T
Write a command to list all databases in mysql?
How do I start mysql server?
What is the latest mysql?
What is the use of mysqli_num_rows?
In which format data is stored in mysql database?
how to Return total number of rows.
What is the difference between BLOB AND TEXT?
1.how to fetch a value and Execute store procudure in mysql(INNODB) using phpMyAdmin? 2.can i wright a package in mysql database(INNODB)?
How to determine the location of the data directory?
How do I rename a procedure?
How to see table's field formats or description of table .