Showing posts with label withexec. Show all posts
Showing posts with label withexec. Show all posts

Thursday, February 16, 2012

2005 local server name help

you have to add the server with
exec sp_addserver 'newname','local'
the key word 'local' will set the serverid to 0.
-oj
"Mike" <mguissine@.hotmail.com> wrote in message
news:1151461463.763845.263690@.75g2000cwc.googlegroups.com...
>I have installed SQL Server 2005 and by mistake replace local server
> name with linked server.
> Ran sp_dropserver 'Localservername' and sp_addserver 'localservername'.
> After that I installed replication on same server and enable it as
> distributor and subscriber.
> It worked fime till server reboot
> After reboot, the replication stopped working. I find out that this is
> due to local server name not exists anymore (it's no record with id=0
> in sys.servers view).
> Now I have real big problem:
> 1. I can't drop linked and add a local server with same name since it
> used in replication.
> 2. I can't drop replication because it's trying to get server by name
> (apparently quering same view) and it returns NULL.
> Any help , please.
> Mike
>I have installed SQL Server 2005 and by mistake replace local server
name with linked server.
Ran sp_dropserver 'Localservername' and sp_addserver 'localservername'.
After that I installed replication on same server and enable it as
distributor and subscriber.
It worked fime till server reboot
After reboot, the replication stopped working. I find out that this is
due to local server name not exists anymore (it's no record with id=0
in sys.servers view).
Now I have real big problem:
1. I can't drop linked and add a local server with same name since it
used in replication.
2. I can't drop replication because it's trying to get server by name
(apparently quering same view) and it returns NULL.
Any help , please.
Mike|||you have to add the server with
exec sp_addserver 'newname','local'
the key word 'local' will set the serverid to 0.
-oj
"Mike" <mguissine@.hotmail.com> wrote in message
news:1151461463.763845.263690@.75g2000cwc.googlegroups.com...
>I have installed SQL Server 2005 and by mistake replace local server
> name with linked server.
> Ran sp_dropserver 'Localservername' and sp_addserver 'localservername'.
> After that I installed replication on same server and enable it as
> distributor and subscriber.
> It worked fime till server reboot
> After reboot, the replication stopped working. I find out that this is
> due to local server name not exists anymore (it's no record with id=0
> in sys.servers view).
> Now I have real big problem:
> 1. I can't drop linked and add a local server with same name since it
> used in replication.
> 2. I can't drop replication because it's trying to get server by name
> (apparently quering same view) and it returns NULL.
> Any help , please.
> Mike
>|||I maybe didn't explained things correctly..
I created linked server with 'LocalServerName' thas my local server
(id=0) does not exists anymore. Now I want to put it back. The right
steps to do it would be:
1. drop linked server. sp_dropserver 'name', 'droplogins'
2. create local server. sp_addserver 'name' , 'local'
The problem is that the server is used in replication, so I can't drop
it hense can't add new server with the same name. I can't do anything
with replication either...
The only way I think is to hack into system tables and change id to 0
for the linked server so it will become local. But it looks like in
SS2005 i don't have that option...
Mike
oj wrote:[vbcol=seagreen]
> you have to add the server with
> exec sp_addserver 'newname','local'
> the key word 'local' will set the serverid to 0.
> --
> -oj
>
> "Mike" <mguissine@.hotmail.com> wrote in message
> news:1151461463.763845.263690@.75g2000cwc.googlegroups.com...|||I maybe didn't explained things correctly..
I created linked server with 'LocalServerName' thas my local server
(id=0) does not exists anymore. Now I want to put it back. The right
steps to do it would be:
1. drop linked server. sp_dropserver 'name', 'droplogins'
2. create local server. sp_addserver 'name' , 'local'
The problem is that the server is used in replication, so I can't drop
it hense can't add new server with the same name. I can't do anything
with replication either...
The only way I think is to hack into system tables and change id to 0
for the linked server so it will become local. But it looks like in
SS2005 i don't have that option...
Mike
oj wrote:[vbcol=seagreen]
> you have to add the server with
> exec sp_addserver 'newname','local'
> the key word 'local' will set the serverid to 0.
> --
> -oj
>
> "Mike" <mguissine@.hotmail.com> wrote in message
> news:1151461463.763845.263690@.75g2000cwc.googlegroups.com...|||Ah. I see your delima. Dropping repl would be the only choice. Sorry.
-oj
"Mike" <mguissine@.hotmail.com> wrote in message
news:1151511040.077204.203160@.j72g2000cwa.googlegroups.com...
>I maybe didn't explained things correctly..
> I created linked server with 'LocalServerName' thas my local server
> (id=0) does not exists anymore. Now I want to put it back. The right
> steps to do it would be:
> 1. drop linked server. sp_dropserver 'name', 'droplogins'
> 2. create local server. sp_addserver 'name' , 'local'
> The problem is that the server is used in replication, so I can't drop
> it hense can't add new server with the same name. I can't do anything
> with replication either...
> The only way I think is to hack into system tables and change id to 0
> for the linked server so it will become local. But it looks like in
> SS2005 i don't have that option...
> Mike
>
> oj wrote:
>