Thursday, March 22, 2012

Create a linked server between 2 sql serve

Hi,
Hw can I create a linked server between 2 sql server databases in diferente
machines?
How can I indicate the 2 catalogs and the 2 servers?
Thanks in advance
Pedro
The syntax is:
[LINKEDSERVER].[Databasename].[owner].[Objectname]
e.g. Select * from [LINKEDSERVER].[Databasename].[owner].[Objectname]
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:B828F7E5-C4A1-41B2-9717-D1DC9433B6DB@.microsoft.com...
> Hi,
> Hw can I create a linked server between 2 sql server databases in
> diferente
> machines?
> How can I indicate the 2 catalogs and the 2 servers?
> Thanks in advance
> Pedro
|||Hi Jens,
My question is how can I create a linkedserver.
Imagine that I have 2 sql server's, SQLSERVER1 with a catalog BOOK and
SQLSERVER2 with a catalog PUBLISHER.
I want to link this to server so I can have a trigger on a table of the BOOK
database on SQLSERVER1 invoke a storeprocedure of database PUBLISHER on
SQLSERVER2
How can I do this?
How can I setup this kind of linkedserver?
On Entreprise manager I can add a linkedserver chose "SQL Server" but I
can't setup the address of the 2 servers or the 2 databases on that 2
servers.
"Jens Sü?meyer" wrote:

> The syntax is:
> [LINKEDSERVER].[Databasename].[owner].[Objectname]
> e.g. Select * from [LINKEDSERVER].[Databasename].[owner].[Objectname]
>
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:B828F7E5-C4A1-41B2-9717-D1DC9433B6DB@.microsoft.com...
>
>
|||I wouldn=B4t do that, trigegr behave synchron, they wait for the
transaction started, so if the line between the servers isn=B4t setup
properly or the other server doesn=B4t repsond you will get into trouble
because the transaction is rolled back.
Anyway, the name of the server (in the menu of the linkedserver) is the
name of the server/instance. The database can be reached with the above
mentioned 4 part notation.
otherwise you could use the sp_addlinkedserver command which can be
found (with samples) int he BOL.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de

No comments:

Post a Comment