Showing posts with label helloi. Show all posts
Showing posts with label helloi. Show all posts

Wednesday, March 28, 2012

Renaming a Server

Hello

I am wondering if this is able to be done and what implications there would
be with SQL Server.

Server1 name: Production Currently running Windows NT and SQL 7
instance name is Production
Server2 name: Test Currently running Windows 2000 and
SQL 2000, instance name is Test - default installation

Bring the Server1 offline and rename Server 2 with the name of Production.
Do we have to change the instance name in SQL now on Server 2? If so can we
do this? I didn't think you could change a instance name and had to
reinstall SQL.

Another Question:

Can you have 2 instances of SQL with the same name but reside on different
servers?

Thanks
SherHi

[cut]
> Another Question:
> Can you have 2 instances of SQL with the same name but reside on different
> servers?
Yes, you can have instance1 on server1 and server2 - you always connect to
any of them specifying full name: server1/instance1 or server2/instance1.

Tomik|||snewell2003 via SQLMonster.com (forum@.SQLMonster.com) writes:
> I am wondering if this is able to be done and what implications there
> would be with SQL Server.
> Server1 name: Production Currently running Windows NT and SQL 7
> instance name is Production
> Server2 name: Test Currently running Windows 2000
> and SQL 2000, instance name is Test - default installation

Is that Test\Test or just Test? Production is obviously not
Production\Prodction as there are no named instances on SQL 7.

> Bring the Server1 offline and rename Server 2 with the name of
> Production. Do we have to change the instance name in SQL now on Server
> 2? If so can we do this? I didn't think you could change a instance
> name and had to reinstall SQL.

If SQL 2000 is a default instance, this should not be difficult. There
is one thing you need to once you have moved:

EXEC sp_dropserver Test
go
EXEC sp_addserver, Production, LOCAL

And the reboot afterthis. Else @.@.servername will be wrong.

> Can you have 2 instances of SQL with the same name but reside on different
> servers?

As long as the machines are not connected to each other. if they are on
the same network, I would not recommend it.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Wednesday, March 21, 2012

rename columns in a temp table

hello
I have a stored procedure that calculates the values of column data based
on an input variable. I would like to rename the columns to the input
variables so that i can directly graph the results of the table. Is this
possible?
for example, a column in the table #summary is called year1 but i need it to
be renamed to '@.inputYear - 5'. So if @.inputYear = 2000, i need the column
to be renamed to 1995.
thanks for any and all help!
benBen wrote:
> hello
> I have a stored procedure that calculates the values of column data
> based on an input variable. I would like to rename the columns to
> the input variables so that i can directly graph the results of the
> table. Is this possible?
> for example, a column in the table #summary is called year1 but i
> need it to be renamed to '@.inputYear - 5'. So if @.inputYear = 2000,
> i need the column to be renamed to 1995.
> thanks for any and all help!
> ben
You can use an alias for the column, but will have to use dynamic sql.
Or you can return two result sets. The first is the name of the columns,
the second is the data to graph.
EXEC ('Select year1 as "' + CAST(@.inputYear - 5 as VARCHAR(4)) + '"
From...')
David Gugick
Quest Software
www.imceda.com
www.quest.com

Monday, February 20, 2012

Removing BUILTIN\ADMINISTRATOR

Hello
I'm sure this has been answered many times, but my search of the newsgroup
gives me hits on messages that have already been 'removed'. Googling hasn't
given me the answer yet either.
I need to remove BUILTIN from many 'inherited' servers that I am called on
to support. I am required to remove it. However, it is also DBO for every
database. All the databases are actually owned by 'sa'. If I try to drop
BUILTIN access to a database I get the 'the database owner cannot be
dropped'. If I try to drop remove the DBO permit for BUILTIN in a database
I get 'Error 15405: Cannot use the reserved user or role name dbo'. UGH!
There's a simple solution for this, right?
Thanks!> I need to remove BUILTIN from many 'inherited' servers that I am called on to support. I
am
> required to remove it. However, it is also DBO for every database. All t
he databases are
> actually owned by 'sa'.
Above is a contradiction. You can't have both BUILTIN\Administrators *and* s
a as owner for a
database! My guess is that the owner is BUILTIN\Administrators. Just change
the owner to sa, using
sp_changedbowner.
Also, before removing the administrators group, add LocalSystem (actual name
is NT
AUTHORITY\SYSTEM). Google for it to see why.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Steve" <pezguy@.mn.rr.com> wrote in message news:fpsbe.31959$215.21781@.tornado.rdc-kc.rr.com
..
> Hello
> I'm sure this has been answered many times, but my search of the newsgroup
gives me hits on
> messages that have already been 'removed'. Googling hasn't given me the an
swer yet either.
> I need to remove BUILTIN from many 'inherited' servers that I am called on
to support. I am
> required to remove it. However, it is also DBO for every database. All t
he databases are
> actually owned by 'sa'. If I try to drop BUILTIN access to a database I g
et the 'the database
> owner cannot be dropped'. If I try to drop remove the DBO permit for BUIL
TIN in a database I get
> 'Error 15405: Cannot use the reserved user or role name dbo'. UGH!
> There's a simple solution for this, right?
> Thanks!
>|||Hi Steve,
Maybe this articles will help you:
"Removing builtin\administrators: Some pitfalls to avoid"
tratorssomepitfallstoavoi.asp" target="_blank">http://www.sqlservercentral.com/col...fallstoavoi.asp
"10 Steps to Securing your SQL Server"
[url]http://www.sqlservercentral.com/columnists/bknight/10securingyoursqlserver.asp[/ur
l]
Cristian Lefter, SQL Server MVP
"Steve" <pezguy@.mn.rr.com> wrote in message
news:fpsbe.31959$215.21781@.tornado.rdc-kc.rr.com...
> Hello
> I'm sure this has been answered many times, but my search of the newsgroup
> gives me hits on messages that have already been 'removed'. Googling
> hasn't given me the answer yet either.
> I need to remove BUILTIN from many 'inherited' servers that I am called on
> to support. I am required to remove it. However, it is also DBO for
> every database. All the databases are actually owned by 'sa'. If I try
> to drop BUILTIN access to a database I get the 'the database owner cannot
> be dropped'. If I try to drop remove the DBO permit for BUILTIN in a
> database I get 'Error 15405: Cannot use the reserved user or role name
> dbo'. UGH!
> There's a simple solution for this, right?
> Thanks!
>