Showing posts with label write. Show all posts
Showing posts with label write. Show all posts

Monday, March 26, 2012

Rename machine with SQL server

I'm trying to write a script to run after changing the computer name of a machine running SQL Server 2005. I know about the article on the SQL Developer center that talks about sp_dropserver and sp_addserver. My question is about the Windows groups that are created with the machine name embedded inside (e.g. MACHINENAME\SQLServer2005MSFTEUser$MACHINENAME$MSSQLSERVER).

Do I need to worry about these? If the answer is no because the name of the group is irrelevant, how do I go about changing the machine name for the login (i.e. the MACHINENAME in front of the slash)? I don't want to hardcode these group names into my script.

Thanks for any help.

There is no need to do anything with those local groups. They're created when you install/setup sqlserver. When you change the computer name, you would need to update sqlserver so that its servername matches up with the computername. See the following article for more detail.

http://msdn2.microsoft.com/en-us/library/ms143799(SQL.90).aspx

Saturday, February 25, 2012

Removing delimiters

Hi

I have a database in which the
bankno is 29 and
acctno is 01-001-0000002

I need to write a query to get the data as "29010010000002" that is to concatenate both the fields and take out the delimiters in the second field. I know how to concatenate both
i.e.

select bankno + acctno as acctnos from table;

But that will give me 2901-001-0000002. I need to modify the query so that I can remove the delimiters in the second column.
Can anyone give me an idea.

Thanx in advance.select
replace(bankno + acctno,'-','')
as acctnos from table;