Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-05-21 : 09:13:50
|
| Frank writes "When I use a Linked Server in a VB project, I need write some code to check whether the Linked Server is localserver or not. How can I get the information from itsproperty?" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-05-21 : 09:27:47
|
| Um, why would you set up the local server as a linked server? That doesn't make any sense to me.A SQL Server can create links to other servers, so that you can perform SQL operations on them as if they were regular servers. This is the syntax used:SELECT * FROM servername.database.owner.tablenameSELECT * FROM serverB.db1.owner.table1You would set up ServerA to have a linked server to ServerB. Once you do that, you can connect to ServerA and run the code example to get data from ServerB. If you only want data from ServerA, you can exclude the server name part from your SELECT statement. |
 |
|
|
fliao
Starting Member
1 Post |
Posted - 2002-05-21 : 22:20:38
|
My code is one of a big project which is developed by some guys.The code that create a linked server is writen by another guy.What I got is just a linked server name. I don't know whichserver will be connected, maybe to a local server which namedloopback linked servers, maybe not.But based on microsoft document, "Loopback linked servers cannot be used in a distributed transaction. ", so I need check the linked server whether it is loopback linked serversor not, then I can write the sql statement as Rob's suggestion. quote: Um, why would you set up the local server as a linked server? That doesn't make any sense to me.A SQL Server can create links to other servers, so that you can perform SQL operations on them as if they were regular servers. This is the syntax used:SELECT * FROM servername.database.owner.tablenameSELECT * FROM serverB.db1.owner.table1You would set up ServerA to have a linked server to ServerB. Once you do that, you can connect to ServerA and run the code example to get data from ServerB. If you only want data from ServerA, you can exclude the server name part from your SELECT statement.
|
 |
|
|
|
|
|
|
|