Showing posts with label exists. Show all posts
Showing posts with label exists. Show all posts

Thursday, March 8, 2012

a server with this name already exists?

Hi SQL Guru's
I have installed sql server 2000 on a new server. Our old server was called
SQL01 and I installed the new server as SQL01 as well (but just not on the
network to avoid the name clash)
I have now removed the old SQL01 server, put the new one in and changed the
IP Address so everything is the same as the old one. When I open EM on the
server itself and try and register it as SQL01 (it is currently local) I get
the error meesage "A Server with this name already exists" and I cannot
register the server.
I can connect to it remotly fine and setup my remote EM with the name SQL01
without any problems, but as soon as I try on the server I get that error.
Firstly does anyone know how to resolve this. I think the new server has
somehow learned about the old one and has remembered it so it won't let me
add this one with the same name. I have tried rebooting it and still does
this, so it's like it's cached the setting somewher and I need to remove
that so I can regoster it correctly.
Thanks for any help.
Teddy
Look at sp_addserver and sp_dropserver stored procedures in the BOL
"Teddy Smith" <teddy@.smith.com> wrote in message
news:ce2b2s$c3h$1@.pinah.connect.com.au...
> Hi SQL Guru's
> I have installed sql server 2000 on a new server. Our old server was
called
> SQL01 and I installed the new server as SQL01 as well (but just not on the
> network to avoid the name clash)
> I have now removed the old SQL01 server, put the new one in and changed
the
> IP Address so everything is the same as the old one. When I open EM on the
> server itself and try and register it as SQL01 (it is currently local) I
get
> the error meesage "A Server with this name already exists" and I cannot
> register the server.
> I can connect to it remotly fine and setup my remote EM with the name
SQL01
> without any problems, but as soon as I try on the server I get that error.
> Firstly does anyone know how to resolve this. I think the new server has
> somehow learned about the old one and has remembered it so it won't let me
> add this one with the same name. I have tried rebooting it and still does
> this, so it's like it's cached the setting somewher and I need to remove
> that so I can regoster it correctly.
> Thanks for any help.
>
|||A server name can only be registered once in SEM... Delete the other server
registration, THEN add the new registration...( I mean delete the LOCAL
registration first.)
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Teddy Smith" <teddy@.smith.com> wrote in message
news:ce2b2s$c3h$1@.pinah.connect.com.au...
> Hi SQL Guru's
> I have installed sql server 2000 on a new server. Our old server was
called
> SQL01 and I installed the new server as SQL01 as well (but just not on the
> network to avoid the name clash)
> I have now removed the old SQL01 server, put the new one in and changed
the
> IP Address so everything is the same as the old one. When I open EM on the
> server itself and try and register it as SQL01 (it is currently local) I
get
> the error meesage "A Server with this name already exists" and I cannot
> register the server.
> I can connect to it remotly fine and setup my remote EM with the name
SQL01
> without any problems, but as soon as I try on the server I get that error.
> Firstly does anyone know how to resolve this. I think the new server has
> somehow learned about the old one and has remembered it so it won't let me
> add this one with the same name. I have tried rebooting it and still does
> this, so it's like it's cached the setting somewher and I need to remove
> that so I can regoster it correctly.
> Thanks for any help.
>

a server with this name already exists?

Hi SQL Guru's
I have installed sql server 2000 on a new server. Our old server was called
SQL01 and I installed the new server as SQL01 as well (but just not on the
network to avoid the name clash)
I have now removed the old SQL01 server, put the new one in and changed the
IP Address so everything is the same as the old one. When I open EM on the
server itself and try and register it as SQL01 (it is currently local) I get
the error meesage "A Server with this name already exists" and I cannot
register the server.
I can connect to it remotly fine and setup my remote EM with the name SQL01
without any problems, but as soon as I try on the server I get that error.
Firstly does anyone know how to resolve this. I think the new server has
somehow learned about the old one and has remembered it so it won't let me
add this one with the same name. I have tried rebooting it and still does
this, so it's like it's cached the setting somewher and I need to remove
that so I can regoster it correctly.
Thanks for any help.Teddy
Look at sp_addserver and sp_dropserver stored procedures in the BOL
"Teddy Smith" <teddy@.smith.com> wrote in message
news:ce2b2s$c3h$1@.pinah.connect.com.au...
> Hi SQL Guru's
> I have installed sql server 2000 on a new server. Our old server was
called
> SQL01 and I installed the new server as SQL01 as well (but just not on the
> network to avoid the name clash)
> I have now removed the old SQL01 server, put the new one in and changed
the
> IP Address so everything is the same as the old one. When I open EM on the
> server itself and try and register it as SQL01 (it is currently local) I
get
> the error meesage "A Server with this name already exists" and I cannot
> register the server.
> I can connect to it remotly fine and setup my remote EM with the name
SQL01
> without any problems, but as soon as I try on the server I get that error.
> Firstly does anyone know how to resolve this. I think the new server has
> somehow learned about the old one and has remembered it so it won't let me
> add this one with the same name. I have tried rebooting it and still does
> this, so it's like it's cached the setting somewher and I need to remove
> that so I can regoster it correctly.
> Thanks for any help.
>|||A server name can only be registered once in SEM... Delete the other server
registration, THEN add the new registration...( I mean delete the LOCAL
registration first.)
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Teddy Smith" <teddy@.smith.com> wrote in message
news:ce2b2s$c3h$1@.pinah.connect.com.au...
> Hi SQL Guru's
> I have installed sql server 2000 on a new server. Our old server was
called
> SQL01 and I installed the new server as SQL01 as well (but just not on the
> network to avoid the name clash)
> I have now removed the old SQL01 server, put the new one in and changed
the
> IP Address so everything is the same as the old one. When I open EM on the
> server itself and try and register it as SQL01 (it is currently local) I
get
> the error meesage "A Server with this name already exists" and I cannot
> register the server.
> I can connect to it remotly fine and setup my remote EM with the name
SQL01
> without any problems, but as soon as I try on the server I get that error.
> Firstly does anyone know how to resolve this. I think the new server has
> somehow learned about the old one and has remembered it so it won't let me
> add this one with the same name. I have tried rebooting it and still does
> this, so it's like it's cached the setting somewher and I need to remove
> that so I can regoster it correctly.
> Thanks for any help.
>

a server with this name already exists?

Hi SQL Guru's
I have installed sql server 2000 on a new server. Our old server was called
SQL01 and I installed the new server as SQL01 as well (but just not on the
network to avoid the name clash)
I have now removed the old SQL01 server, put the new one in and changed the
IP Address so everything is the same as the old one. When I open EM on the
server itself and try and register it as SQL01 (it is currently local) I get
the error meesage "A Server with this name already exists" and I cannot
register the server.
I can connect to it remotly fine and setup my remote EM with the name SQL01
without any problems, but as soon as I try on the server I get that error.
Firstly does anyone know how to resolve this. I think the new server has
somehow learned about the old one and has remembered it so it won't let me
add this one with the same name. I have tried rebooting it and still does
this, so it's like it's cached the setting somewher and I need to remove
that so I can regoster it correctly.
Thanks for any help.Teddy
Look at sp_addserver and sp_dropserver stored procedures in the BOL
"Teddy Smith" <teddy@.smith.com> wrote in message
news:ce2b2s$c3h$1@.pinah.connect.com.au...
> Hi SQL Guru's
> I have installed sql server 2000 on a new server. Our old server was
called
> SQL01 and I installed the new server as SQL01 as well (but just not on the
> network to avoid the name clash)
> I have now removed the old SQL01 server, put the new one in and changed
the
> IP Address so everything is the same as the old one. When I open EM on the
> server itself and try and register it as SQL01 (it is currently local) I
get
> the error meesage "A Server with this name already exists" and I cannot
> register the server.
> I can connect to it remotly fine and setup my remote EM with the name
SQL01
> without any problems, but as soon as I try on the server I get that error.
> Firstly does anyone know how to resolve this. I think the new server has
> somehow learned about the old one and has remembered it so it won't let me
> add this one with the same name. I have tried rebooting it and still does
> this, so it's like it's cached the setting somewher and I need to remove
> that so I can regoster it correctly.
> Thanks for any help.
>|||A server name can only be registered once in SEM... Delete the other server
registration, THEN add the new registration...( I mean delete the LOCAL
registration first.)
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Teddy Smith" <teddy@.smith.com> wrote in message
news:ce2b2s$c3h$1@.pinah.connect.com.au...
> Hi SQL Guru's
> I have installed sql server 2000 on a new server. Our old server was
called
> SQL01 and I installed the new server as SQL01 as well (but just not on the
> network to avoid the name clash)
> I have now removed the old SQL01 server, put the new one in and changed
the
> IP Address so everything is the same as the old one. When I open EM on the
> server itself and try and register it as SQL01 (it is currently local) I
get
> the error meesage "A Server with this name already exists" and I cannot
> register the server.
> I can connect to it remotly fine and setup my remote EM with the name
SQL01
> without any problems, but as soon as I try on the server I get that error.
> Firstly does anyone know how to resolve this. I think the new server has
> somehow learned about the old one and has remembered it so it won't let me
> add this one with the same name. I have tried rebooting it and still does
> this, so it's like it's cached the setting somewher and I need to remove
> that so I can regoster it correctly.
> Thanks for any help.
>

Tuesday, March 6, 2012

a server with this name already exists

Hi
I deleted the registration for my sql server. When I try
to re-add it in ent. mgr I get the error "a server with
this name already exists".
Any ideas?
Thanks
MarkCheck in the other EM groups for a registered server of
the same name. You have already registered a server of the
same name, just exactly as the message indicates.
Linchi
>--Original Message--
>Hi
>I deleted the registration for my sql server. When I try
>to re-add it in ent. mgr I get the error "a server with
>this name already exists".
>Any ideas?
>Thanks
>Mark
>.
>|||Hi Linchi
The server is not registered under any other groups, which
is why I was confused by the error. I'm able to still
stop/start the server thru service manager.
>--Original Message--
>Check in the other EM groups for a registered server of
>the same name. You have already registered a server of
the
>same name, just exactly as the message indicates.
>Linchi
>>--Original Message--
>>Hi
>>I deleted the registration for my sql server. When I try
>>to re-add it in ent. mgr I get the error "a server with
>>this name already exists".
>>Any ideas?
>>Thanks
>>Mark
>>.
>.
>

Thursday, February 9, 2012

A Good insert record if non existant Stored Procedure

Can anyone spare me a good SP that ...

checks if the record exists - and if so return the identity.

and if the record does not exist

inserts it and returns the identity.

Mine keep flipping up :) so I rather look at someone else and use theirs.

Thanks in advance.

Create Proc Proc1
(
parameters...,
@.out int = null output
)
as

select @.out = identcolumn from table1 where ... (use other parameters to determine what to look for)

if @.out is not null
return

insert into table1 (field list)
values (parameters)

set @.out = @.@.identity

return

You could use EXISTS, but in this case you want the identity column. So, if you use EXISTS, you'd have to do a second query to get the identity. Just do one query, if it's there send back the ID, if not, insert it and send back the ID. You could add another output parameter if want to indicate whether you inserted or not.|||Its the same thing I was doing - somehow mine keeps tripping up. Anyway, I was hoping maybe there was a more efficient means aside from two queries.

Thanks for the insight!|||you could combine the insert with the (not) exists into one batch, but really what's the point? It a bit like those mad people that write whole programs in C on one line.