Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Friday, March 30, 2012

How to rename physical file name

I have a database, which consists of two physical files db1.mdf,
db1_log.ldf, both locating on the same folder. I want to copy both the files
to db2.mdf, db2_log.ldf (in the same folder) and attach as DB2. I know the
commands to attach a database with different name. I want to know, how to
change db1.mdf to db2.mdf
TIA
J JustinJustin
I prefer RESTORE DATABASE from QA rather than EM. In the QA just before a
running change the names of the files
RESTORE DATABASE MyDatabase FROM DISK='C:\MyDatabase20050206.bak'
WITH RECOVERY,
MOVE MyDatabase_Data' TO 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\ChangeItHere.mdf',
MOVE MyDatabase _Log' TO 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\ChangeItHere_log.ldf'
"J Justin" <justin@.gjsoft.com> wrote in message
news:eRxy9uXdFHA.3184@.TK2MSFTNGP15.phx.gbl...
> I have a database, which consists of two physical files db1.mdf,
> db1_log.ldf, both locating on the same folder. I want to copy both the
files
> to db2.mdf, db2_log.ldf (in the same folder) and attach as DB2. I know the
> commands to attach a database with different name. I want to know, how to
> change db1.mdf to db2.mdf
> TIA
> J Justin
>|||Thanks for your quick reply. I don't have BAK file, rather I have the raw
mdf and ldf files. Is there any command now?
Regards
J Justin
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%233lXN0XdFHA.2688@.TK2MSFTNGP14.phx.gbl...
> Justin
> I prefer RESTORE DATABASE from QA rather than EM. In the QA just before a
> running change the names of the files
> RESTORE DATABASE MyDatabase FROM DISK='C:\MyDatabase20050206.bak'
> WITH RECOVERY,
> MOVE MyDatabase_Data' TO 'C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\ChangeItHere.mdf',
> MOVE MyDatabase _Log' TO 'C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\ChangeItHere_log.ldf'
>
>
> "J Justin" <justin@.gjsoft.com> wrote in message
> news:eRxy9uXdFHA.3184@.TK2MSFTNGP15.phx.gbl...
>> I have a database, which consists of two physical files db1.mdf,
>> db1_log.ldf, both locating on the same folder. I want to copy both the
> files
>> to db2.mdf, db2_log.ldf (in the same folder) and attach as DB2. I know
>> the
>> commands to attach a database with different name. I want to know, how to
>> change db1.mdf to db2.mdf
>> TIA
>> J Justin
>>
>|||No, after dettaching database rename the files manual .
"J Justin" <justin@.gjsoft.com> wrote in message
news:%23$K7r9XdFHA.1684@.TK2MSFTNGP09.phx.gbl...
> Thanks for your quick reply. I don't have BAK file, rather I have the raw
> mdf and ldf files. Is there any command now?
> Regards
> J Justin
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:%233lXN0XdFHA.2688@.TK2MSFTNGP14.phx.gbl...
> > Justin
> > I prefer RESTORE DATABASE from QA rather than EM. In the QA just before
a
> > running change the names of the files
> >
> > RESTORE DATABASE MyDatabase FROM DISK='C:\MyDatabase20050206.bak'
> > WITH RECOVERY,
> > MOVE MyDatabase_Data' TO 'C:\Program Files\Microsoft SQL
> > Server\MSSQL\Data\ChangeItHere.mdf',
> > MOVE MyDatabase _Log' TO 'C:\Program Files\Microsoft SQL
> > Server\MSSQL\Data\ChangeItHere_log.ldf'
> >
> >
> >
> >
> >
> > "J Justin" <justin@.gjsoft.com> wrote in message
> > news:eRxy9uXdFHA.3184@.TK2MSFTNGP15.phx.gbl...
> >> I have a database, which consists of two physical files db1.mdf,
> >> db1_log.ldf, both locating on the same folder. I want to copy both the
> > files
> >> to db2.mdf, db2_log.ldf (in the same folder) and attach as DB2. I know
> >> the
> >> commands to attach a database with different name. I want to know, how
to
> >> change db1.mdf to db2.mdf
> >>
> >> TIA
> >>
> >> J Justin
> >>
> >>
> >
> >
>

How to rename instance

Hi,
I installed sql05 on a new box and I don't like the name I chose for the
instance.
How do I change it?
TIA,
Mike
Backup your databases, uninstall SQL Server, install it properly, then
restore your databases. There is no sp_rename_instance.
"Mike" <mikenospam@.yahoo.es> wrote in message
news:691977F7-8CB6-4107-B71E-6584B15311D4@.microsoft.com...
> Hi,
> I installed sql05 on a new box and I don't like the name I chose for the
> instance.
> How do I change it?
> TIA,
> Mike
>

How to rename instance

Hi,
I installed sql05 on a new box and I don't like the name I chose for the
instance.
How do I change it?
TIA,
MikeBackup your databases, uninstall SQL Server, install it properly, then
restore your databases. There is no sp_rename_instance.
"Mike" <mikenospam@.yahoo.es> wrote in message
news:691977F7-8CB6-4107-B71E-6584B15311D4@.microsoft.com...
> Hi,
> I installed sql05 on a new box and I don't like the name I chose for the
> instance.
> How do I change it?
> TIA,
> Mike
>

how to rename files before send files?

I'm using script task to rename files inside foreach loop files,code like shown below

Dim file As New System.IO.FileInfo(CStr(Dts.Variables("User::FileName").Value))

dim newname as string = Split(file.Name, "_")(0) & ".jpg"
Dts.Variables("User::outputname").Value = file.DirectoryName & "\" & newname

Then,i use ftp task to send files,but prompt "the variables User::outputname doesn't contains file path(s)"

I tried to use file system task to perform that,but failed either

Rename file operation in file system only can rename a file in a specified location,who can help me?

TIA

Have you looked at what outputname does contain? Does the file specified exist as it should for the FTP task?

The File System Task can use variables, which themselves can be used to supply expressions, see the EvaluateAsExpression property and set the Expression property. This way you can use dynamic paths in the File System Task.

sql

How to Rename Database Files

Is there a way to totally rename a databases? I would like to change the
name of the database - like with sp_renamedb and the assosciated files so
that they still match. Is there an easy way to do this? I would really like
a TSQL script to do this if possible.
Thanks in advance.Hi Tim
What version are you using? Please always mention that right up front.
In SQL Server 2000 you can change the logical file names using ALTER
DATABASE, but in SQL Server 7 you cannot.
To change the physical files names, there is no way to do this in TSQL
(except for tempdb), so it would be tricky to do this in a script.
The steps to change physical file names are:
Detach the database
rename the files at the operating system
Attach the database, specifying the new file names
Check the docs for sp_attachdb for full details.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Tim Bird" <tsbdoulos@.nospambtopenworld.com> wrote in message
news:uDWhPZUKEHA.556@.TK2MSFTNGP10.phx.gbl...
> Is there a way to totally rename a databases? I would like to change the
> name of the database - like with sp_renamedb and the assosciated files so
> that they still match. Is there an easy way to do this? I would really
like
> a TSQL script to do this if possible.
> Thanks in advance.
>|||Tim
Detach the database. Rename the windows files and attach as whatever name yo
u like.
Regards
John|||Hi John
Note that this will not change the logical file names. That must be done
separately and in SQL Server 7 it is not possible to change the logical file
names at all.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
news:851FB97A-324C-40DD-95D9-3704D66EB621@.microsoft.com...
> Tim
> Detach the database. Rename the windows files and attach as whatever name
you like.
> Regards
> John|||Hi,
In SQL 2000 the logical file name can be changed by using the below command.
The below step is not possible in SQL 7
ALTER DATABASE
MODIFY FILE
(NAME = logical_file_name,
NEWNAME = new_logical_name)
How to change the physical name in both SQL 2000 / SQL 7
1. detach the database using sp_detach_db <dbname>
2. Rename the physical files to new name
3. attach the database using sp_attach_db 'dbname','new physical MDF name
with path','new physical LDF name with path'
Thanks
Hari
MCDBA
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:e$uJwLVKEHA.2756@.TK2MSFTNGP10.phx.gbl...
> Hi John
> Note that this will not change the logical file names. That must be done
> separately and in SQL Server 7 it is not possible to change the logical
file
> names at all.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
> news:851FB97A-324C-40DD-95D9-3704D66EB621@.microsoft.com...
name[vbcol=seagreen]
> you like.
>|||Yes, I just said that John's approach would not change the logical file
names. Earlier in the thread I told the original poster he could use ALTER
DATABASE to change the logical file names.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:urPajkVKEHA.3704@.TK2MSFTNGP11.phx.gbl...
> Hi,
> In SQL 2000 the logical file name can be changed by using the below
command.
> The below step is not possible in SQL 7
> ALTER DATABASE
> MODIFY FILE
> (NAME = logical_file_name,
> NEWNAME = new_logical_name)
> How to change the physical name in both SQL 2000 / SQL 7
> 1. detach the database using sp_detach_db <dbname>
> 2. Rename the physical files to new name
> 3. attach the database using sp_attach_db 'dbname','new physical MDF name
> with path','new physical LDF name with path'
> Thanks
> Hari
> MCDBA
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:e$uJwLVKEHA.2756@.TK2MSFTNGP10.phx.gbl...
> file
> name
>|||Kalen
Maybe I am missing something here, I did what I described and it worked just
fine. (This is in 2000, I did not have a 7 environment available.) I crea
ted a database called 'Fred'. I detached 'Fred'. I renamed the MDF and LDF f
iles to 'Pete'. I attached
database as 'Pete'. Database 'Pete' seems to be just fine. What did I miss?
Regards
John|||It depends. I understood the OP to say he wanted to change the file names to
match the new database name, and I assume he wanted the logical filenames to
match also. What good is having a database named Pete, with physical files
named Pete, but logical files named Fred?
I'm not surprised the db is working fine for you, but I think your logical
file names are still Fred. I understood the OP wanted all names changed. He
didn't just want it to 'work', he wanted it to 'look right' also.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
news:0C49A43F-4B84-472B-88C0-29F561A56244@.microsoft.com...
> Kalen
> Maybe I am missing something here, I did what I described and it worked
just fine. (This is in 2000, I did not have a 7 environment available.) I
created a database called 'Fred'. I detached 'Fred'. I renamed the MDF and
LDF files to 'Pete'. I attached database as 'Pete'. Database 'Pete' seems to
be just fine. What did I miss?
> Regards
> John|||"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:e%23LFfB$KEHA.620@.TK2MSFTNGP10.phx.gbl...
> It depends. I understood the OP to say he wanted to change the file names
to
> match the new database name, and I assume he wanted the logical filenames
to
> match also. What good is having a database named Pete, with physical files
> named Pete, but logical files named Fred?
> I'm not surprised the db is working fine for you, but I think your logical
> file names are still Fred. I understood the OP wanted all names changed.
He
> didn't just want it to 'work', he wanted it to 'look right' also.
You are correct. That was my intention. Though it really had to be a program
based solution that an end user of our system could perform. In the end I
have gone for a slightly different solution. Unless anybody can think of a
way to get the SQL Server itself to rename files. As this is will be run
from a client machine and not the server.
Thanks for all your replies anyone who has helped.

> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
> news:0C49A43F-4B84-472B-88C0-29F561A56244@.microsoft.com...
> just fine. (This is in 2000, I did not have a 7 environment available.)
I
> created a database called 'Fred'. I detached 'Fred'. I renamed the MDF and
> LDF files to 'Pete'. I attached database as 'Pete'. Database 'Pete' seems
to
> be just fine. What did I miss?
>|||Tim
Once the database is detached, SQL Server can rename the physical files
using xp_cmdshell. For an end-user to use this, it would have to be in a
stored procedure that you have granted the user permission to execute.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Tim Bird" <tsbdoulos@.nospambtopenworld.com> wrote in message
news:OBDshsCLEHA.1348@.TK2MSFTNGP12.phx.gbl...
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:e%23LFfB$KEHA.620@.TK2MSFTNGP10.phx.gbl...
names[vbcol=seagreen]
> to
filenames[vbcol=seagreen]
> to
files[vbcol=seagreen]
logical[vbcol=seagreen]
> He
> You are correct. That was my intention. Though it really had to be a
program
> based solution that an end user of our system could perform. In the end I
> have gone for a slightly different solution. Unless anybody can think of a
> way to get the SQL Server itself to rename files. As this is will be run
> from a client machine and not the server.
> Thanks for all your replies anyone who has helped.
>
worked[vbcol=seagreen]
> I
and[vbcol=seagreen]
seems[vbcol=seagreen]
> to
>

How to Rename Database Files

Is there a way to totally rename a databases? I would like to change the
name of the database - like with sp_renamedb and the assosciated files so
that they still match. Is there an easy way to do this? I would really like
a TSQL script to do this if possible.
Thanks in advance.
Hi Tim
What version are you using? Please always mention that right up front.
In SQL Server 2000 you can change the logical file names using ALTER
DATABASE, but in SQL Server 7 you cannot.
To change the physical files names, there is no way to do this in TSQL
(except for tempdb), so it would be tricky to do this in a script.
The steps to change physical file names are:
Detach the database
rename the files at the operating system
Attach the database, specifying the new file names
Check the docs for sp_attachdb for full details.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Tim Bird" <tsbdoulos@.nospambtopenworld.com> wrote in message
news:uDWhPZUKEHA.556@.TK2MSFTNGP10.phx.gbl...
> Is there a way to totally rename a databases? I would like to change the
> name of the database - like with sp_renamedb and the assosciated files so
> that they still match. Is there an easy way to do this? I would really
like
> a TSQL script to do this if possible.
> Thanks in advance.
>
|||Tim
Detach the database. Rename the windows files and attach as whatever name you like.
Regards
John
|||Hi John
Note that this will not change the logical file names. That must be done
separately and in SQL Server 7 it is not possible to change the logical file
names at all.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
news:851FB97A-324C-40DD-95D9-3704D66EB621@.microsoft.com...
> Tim
> Detach the database. Rename the windows files and attach as whatever name
you like.
> Regards
> John
|||Hi,
In SQL 2000 the logical file name can be changed by using the below command.
The below step is not possible in SQL 7
ALTER DATABASE
MODIFY FILE
(NAME = logical_file_name,
NEWNAME = new_logical_name)
How to change the physical name in both SQL 2000 / SQL 7
1. detach the database using sp_detach_db <dbname>
2. Rename the physical files to new name
3. attach the database using sp_attach_db 'dbname','new physical MDF name
with path','new physical LDF name with path'
Thanks
Hari
MCDBA
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:e$uJwLVKEHA.2756@.TK2MSFTNGP10.phx.gbl...
> Hi John
> Note that this will not change the logical file names. That must be done
> separately and in SQL Server 7 it is not possible to change the logical
file[vbcol=seagreen]
> names at all.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
> news:851FB97A-324C-40DD-95D9-3704D66EB621@.microsoft.com...
name
> you like.
>
|||Yes, I just said that John's approach would not change the logical file
names. Earlier in the thread I told the original poster he could use ALTER
DATABASE to change the logical file names.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:urPajkVKEHA.3704@.TK2MSFTNGP11.phx.gbl...
> Hi,
> In SQL 2000 the logical file name can be changed by using the below
command.
> The below step is not possible in SQL 7
> ALTER DATABASE
> MODIFY FILE
> (NAME = logical_file_name,
> NEWNAME = new_logical_name)
> How to change the physical name in both SQL 2000 / SQL 7
> 1. detach the database using sp_detach_db <dbname>
> 2. Rename the physical files to new name
> 3. attach the database using sp_attach_db 'dbname','new physical MDF name
> with path','new physical LDF name with path'
> Thanks
> Hari
> MCDBA
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:e$uJwLVKEHA.2756@.TK2MSFTNGP10.phx.gbl...
> file
> name
>
|||Kalen
Maybe I am missing something here, I did what I described and it worked just fine. (This is in 2000, I did not have a 7 environment available.) I created a database called 'Fred'. I detached 'Fred'. I renamed the MDF and LDF files to 'Pete'. I attached
database as 'Pete'. Database 'Pete' seems to be just fine. What did I miss?
Regards
John
|||It depends. I understood the OP to say he wanted to change the file names to
match the new database name, and I assume he wanted the logical filenames to
match also. What good is having a database named Pete, with physical files
named Pete, but logical files named Fred?
I'm not surprised the db is working fine for you, but I think your logical
file names are still Fred. I understood the OP wanted all names changed. He
didn't just want it to 'work', he wanted it to 'look right' also.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
news:0C49A43F-4B84-472B-88C0-29F561A56244@.microsoft.com...
> Kalen
> Maybe I am missing something here, I did what I described and it worked
just fine. (This is in 2000, I did not have a 7 environment available.) I
created a database called 'Fred'. I detached 'Fred'. I renamed the MDF and
LDF files to 'Pete'. I attached database as 'Pete'. Database 'Pete' seems to
be just fine. What did I miss?
> Regards
> John
|||"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:e%23LFfB$KEHA.620@.TK2MSFTNGP10.phx.gbl...
> It depends. I understood the OP to say he wanted to change the file names
to
> match the new database name, and I assume he wanted the logical filenames
to
> match also. What good is having a database named Pete, with physical files
> named Pete, but logical files named Fred?
> I'm not surprised the db is working fine for you, but I think your logical
> file names are still Fred. I understood the OP wanted all names changed.
He
> didn't just want it to 'work', he wanted it to 'look right' also.
You are correct. That was my intention. Though it really had to be a program
based solution that an end user of our system could perform. In the end I
have gone for a slightly different solution. Unless anybody can think of a
way to get the SQL Server itself to rename files. As this is will be run
from a client machine and not the server.
Thanks for all your replies anyone who has helped.

> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
> news:0C49A43F-4B84-472B-88C0-29F561A56244@.microsoft.com...
> just fine. (This is in 2000, I did not have a 7 environment available.)
I
> created a database called 'Fred'. I detached 'Fred'. I renamed the MDF and
> LDF files to 'Pete'. I attached database as 'Pete'. Database 'Pete' seems
to
> be just fine. What did I miss?
>
|||Tim
Once the database is detached, SQL Server can rename the physical files
using xp_cmdshell. For an end-user to use this, it would have to be in a
stored procedure that you have granted the user permission to execute.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Tim Bird" <tsbdoulos@.nospambtopenworld.com> wrote in message
news:OBDshsCLEHA.1348@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:e%23LFfB$KEHA.620@.TK2MSFTNGP10.phx.gbl...
names[vbcol=seagreen]
> to
filenames[vbcol=seagreen]
> to
files[vbcol=seagreen]
logical
> He
> You are correct. That was my intention. Though it really had to be a
program[vbcol=seagreen]
> based solution that an end user of our system could perform. In the end I
> have gone for a slightly different solution. Unless anybody can think of a
> way to get the SQL Server itself to rename files. As this is will be run
> from a client machine and not the server.
> Thanks for all your replies anyone who has helped.
worked[vbcol=seagreen]
> I
and[vbcol=seagreen]
seems
> to
>

How to Rename Database Files

Is there a way to totally rename a databases? I would like to change the
name of the database - like with sp_renamedb and the assosciated files so
that they still match. Is there an easy way to do this? I would really like
a TSQL script to do this if possible.
Thanks in advance.Hi Tim
What version are you using? Please always mention that right up front.
In SQL Server 2000 you can change the logical file names using ALTER
DATABASE, but in SQL Server 7 you cannot.
To change the physical files names, there is no way to do this in TSQL
(except for tempdb), so it would be tricky to do this in a script.
The steps to change physical file names are:
Detach the database
rename the files at the operating system
Attach the database, specifying the new file names
Check the docs for sp_attachdb for full details.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Tim Bird" <tsbdoulos@.nospambtopenworld.com> wrote in message
news:uDWhPZUKEHA.556@.TK2MSFTNGP10.phx.gbl...
> Is there a way to totally rename a databases? I would like to change the
> name of the database - like with sp_renamedb and the assosciated files so
> that they still match. Is there an easy way to do this? I would really
like
> a TSQL script to do this if possible.
> Thanks in advance.
>|||Hi John
Note that this will not change the logical file names. That must be done
separately and in SQL Server 7 it is not possible to change the logical file
names at all.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
news:851FB97A-324C-40DD-95D9-3704D66EB621@.microsoft.com...
> Tim
> Detach the database. Rename the windows files and attach as whatever name
you like.
> Regards
> John|||Hi,
In SQL 2000 the logical file name can be changed by using the below command.
The below step is not possible in SQL 7
ALTER DATABASE
MODIFY FILE
(NAME = logical_file_name,
NEWNAME = new_logical_name)
How to change the physical name in both SQL 2000 / SQL 7
1. detach the database using sp_detach_db <dbname>
2. Rename the physical files to new name
3. attach the database using sp_attach_db 'dbname','new physical MDF name
with path','new physical LDF name with path'
Thanks
Hari
MCDBA
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:e$uJwLVKEHA.2756@.TK2MSFTNGP10.phx.gbl...
> Hi John
> Note that this will not change the logical file names. That must be done
> separately and in SQL Server 7 it is not possible to change the logical
file
> names at all.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
> news:851FB97A-324C-40DD-95D9-3704D66EB621@.microsoft.com...
> > Tim
> >
> > Detach the database. Rename the windows files and attach as whatever
name
> you like.
> >
> > Regards
> >
> > John
>|||Yes, I just said that John's approach would not change the logical file
names. Earlier in the thread I told the original poster he could use ALTER
DATABASE to change the logical file names.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:urPajkVKEHA.3704@.TK2MSFTNGP11.phx.gbl...
> Hi,
> In SQL 2000 the logical file name can be changed by using the below
command.
> The below step is not possible in SQL 7
> ALTER DATABASE
> MODIFY FILE
> (NAME = logical_file_name,
> NEWNAME = new_logical_name)
> How to change the physical name in both SQL 2000 / SQL 7
> 1. detach the database using sp_detach_db <dbname>
> 2. Rename the physical files to new name
> 3. attach the database using sp_attach_db 'dbname','new physical MDF name
> with path','new physical LDF name with path'
> Thanks
> Hari
> MCDBA
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:e$uJwLVKEHA.2756@.TK2MSFTNGP10.phx.gbl...
> > Hi John
> >
> > Note that this will not change the logical file names. That must be done
> > separately and in SQL Server 7 it is not possible to change the logical
> file
> > names at all.
> >
> > --
> > HTH
> > --
> > Kalen Delaney
> > SQL Server MVP
> > www.SolidQualityLearning.com
> >
> >
> > "John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
> > news:851FB97A-324C-40DD-95D9-3704D66EB621@.microsoft.com...
> > > Tim
> > >
> > > Detach the database. Rename the windows files and attach as whatever
> name
> > you like.
> > >
> > > Regards
> > >
> > > John
> >
> >
>|||Kale
Maybe I am missing something here, I did what I described and it worked just fine. (This is in 2000, I did not have a 7 environment available.) I created a database called 'Fred'. I detached 'Fred'. I renamed the MDF and LDF files to 'Pete'. I attached database as 'Pete'. Database 'Pete' seems to be just fine. What did I miss
Regard
John|||It depends. I understood the OP to say he wanted to change the file names to
match the new database name, and I assume he wanted the logical filenames to
match also. What good is having a database named Pete, with physical files
named Pete, but logical files named Fred?
I'm not surprised the db is working fine for you, but I think your logical
file names are still Fred. I understood the OP wanted all names changed. He
didn't just want it to 'work', he wanted it to 'look right' also.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
news:0C49A43F-4B84-472B-88C0-29F561A56244@.microsoft.com...
> Kalen
> Maybe I am missing something here, I did what I described and it worked
just fine. (This is in 2000, I did not have a 7 environment available.) I
created a database called 'Fred'. I detached 'Fred'. I renamed the MDF and
LDF files to 'Pete'. I attached database as 'Pete'. Database 'Pete' seems to
be just fine. What did I miss?
> Regards
> John|||"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:e%23LFfB$KEHA.620@.TK2MSFTNGP10.phx.gbl...
> It depends. I understood the OP to say he wanted to change the file names
to
> match the new database name, and I assume he wanted the logical filenames
to
> match also. What good is having a database named Pete, with physical files
> named Pete, but logical files named Fred?
> I'm not surprised the db is working fine for you, but I think your logical
> file names are still Fred. I understood the OP wanted all names changed.
He
> didn't just want it to 'work', he wanted it to 'look right' also.
You are correct. That was my intention. Though it really had to be a program
based solution that an end user of our system could perform. In the end I
have gone for a slightly different solution. Unless anybody can think of a
way to get the SQL Server itself to rename files. As this is will be run
from a client machine and not the server.
Thanks for all your replies anyone who has helped.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
> news:0C49A43F-4B84-472B-88C0-29F561A56244@.microsoft.com...
> > Kalen
> >
> > Maybe I am missing something here, I did what I described and it worked
> just fine. (This is in 2000, I did not have a 7 environment available.)
I
> created a database called 'Fred'. I detached 'Fred'. I renamed the MDF and
> LDF files to 'Pete'. I attached database as 'Pete'. Database 'Pete' seems
to
> be just fine. What did I miss?
> >
> > Regards
> >
> > John
>|||Tim
Once the database is detached, SQL Server can rename the physical files
using xp_cmdshell. For an end-user to use this, it would have to be in a
stored procedure that you have granted the user permission to execute.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Tim Bird" <tsbdoulos@.nospambtopenworld.com> wrote in message
news:OBDshsCLEHA.1348@.TK2MSFTNGP12.phx.gbl...
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:e%23LFfB$KEHA.620@.TK2MSFTNGP10.phx.gbl...
> > It depends. I understood the OP to say he wanted to change the file
names
> to
> > match the new database name, and I assume he wanted the logical
filenames
> to
> > match also. What good is having a database named Pete, with physical
files
> > named Pete, but logical files named Fred?
> >
> > I'm not surprised the db is working fine for you, but I think your
logical
> > file names are still Fred. I understood the OP wanted all names changed.
> He
> > didn't just want it to 'work', he wanted it to 'look right' also.
> You are correct. That was my intention. Though it really had to be a
program
> based solution that an end user of our system could perform. In the end I
> have gone for a slightly different solution. Unless anybody can think of a
> way to get the SQL Server itself to rename files. As this is will be run
> from a client machine and not the server.
> Thanks for all your replies anyone who has helped.
> >
> > --
> > HTH
> > --
> > Kalen Delaney
> > SQL Server MVP
> > www.SolidQualityLearning.com
> >
> >
> > "John Bandettini" <anonymous@.discussions.microsoft.com> wrote in message
> > news:0C49A43F-4B84-472B-88C0-29F561A56244@.microsoft.com...
> > > Kalen
> > >
> > > Maybe I am missing something here, I did what I described and it
worked
> > just fine. (This is in 2000, I did not have a 7 environment available.)
> I
> > created a database called 'Fred'. I detached 'Fred'. I renamed the MDF
and
> > LDF files to 'Pete'. I attached database as 'Pete'. Database 'Pete'
seems
> to
> > be just fine. What did I miss?
> > >
> > > Regards
> > >
> > > John
> >
> >
>|||Thanks. That is pretty much what I came up with. Anoyingly I have got all
this figured out just as the people who decide have decided that this
feature is no longer needed in the software. Isn't that always the way
?!!!!!
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:e2FSTXELEHA.2556@.TK2MSFTNGP11.phx.gbl...
> Tim
> Once the database is detached, SQL Server can rename the physical files
> using xp_cmdshell. For an end-user to use this, it would have to be in a
> stored procedure that you have granted the user permission to execute.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Tim Bird" <tsbdoulos@.nospambtopenworld.com> wrote in message
> news:OBDshsCLEHA.1348@.TK2MSFTNGP12.phx.gbl...
> >
> > "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> > news:e%23LFfB$KEHA.620@.TK2MSFTNGP10.phx.gbl...
> > > It depends. I understood the OP to say he wanted to change the file
> names
> > to
> > > match the new database name, and I assume he wanted the logical
> filenames
> > to
> > > match also. What good is having a database named Pete, with physical
> files
> > > named Pete, but logical files named Fred?
> > >
> > > I'm not surprised the db is working fine for you, but I think your
> logical
> > > file names are still Fred. I understood the OP wanted all names
changed.
> > He
> > > didn't just want it to 'work', he wanted it to 'look right' also.
> >
> > You are correct. That was my intention. Though it really had to be a
> program
> > based solution that an end user of our system could perform. In the end
I
> > have gone for a slightly different solution. Unless anybody can think of
a
> > way to get the SQL Server itself to rename files. As this is will be run
> > from a client machine and not the server.
> >
> > Thanks for all your replies anyone who has helped.
> >
> > >
> > > --
> > > HTH
> > > --
> > > Kalen Delaney
> > > SQL Server MVP
> > > www.SolidQualityLearning.com
> > >
> > >
> > > "John Bandettini" <anonymous@.discussions.microsoft.com> wrote in
message
> > > news:0C49A43F-4B84-472B-88C0-29F561A56244@.microsoft.com...
> > > > Kalen
> > > >
> > > > Maybe I am missing something here, I did what I described and it
> worked
> > > just fine. (This is in 2000, I did not have a 7 environment
available.)
> > I
> > > created a database called 'Fred'. I detached 'Fred'. I renamed the MDF
> and
> > > LDF files to 'Pete'. I attached database as 'Pete'. Database 'Pete'
> seems
> > to
> > > be just fine. What did I miss?
> > > >
> > > > Regards
> > > >
> > > > John
> > >
> > >
> >
> >
>

How to rename an instance

I have a machine with both SQL Server 2000 and SQL Server 2005. I found
out that I cannot use an instance name for SQL Server 2000 that has
already been used by SQL Server 2005.
I need to rename the instance named "APP_DB" in SQL Server 2005 to be
"APP_DB05", and use "APP_DB" for SQL Server 2000. That way I don't have
to uninstall "APP_DB" from SQL Server 2005 because I need it in the future.
So, how to rename an instance? Thanks.Hi
I don't know of a way to do this other than stop the services for the SQL
2005 instance of APP_DB and install a new instance. You can detach/attach
from one instance to the other. This is not going to save you much and will
use up disc space.
John
"q_test" <jluost1@.yahoo.com> wrote in message
news:4443EC3F.7080901@.yahoo.com...
>I have a machine with both SQL Server 2000 and SQL Server 2005. I found out
>that I cannot use an instance name for SQL Server 2000 that has already
>been used by SQL Server 2005.
> I need to rename the instance named "APP_DB" in SQL Server 2005 to be
> "APP_DB05", and use "APP_DB" for SQL Server 2000. That way I don't have to
> uninstall "APP_DB" from SQL Server 2005 because I need it in the future.
> So, how to rename an instance? Thanks.
>

How to rename an instance

I have a machine with both SQL Server 2000 and SQL Server 2005. I found
out that I cannot use an instance name for SQL Server 2000 that has
already been used by SQL Server 2005.
I need to rename the instance named "APP_DB" in SQL Server 2005 to be
"APP_DB05", and use "APP_DB" for SQL Server 2000. That way I don't have
to uninstall "APP_DB" from SQL Server 2005 because I need it in the future.
So, how to rename an instance? Thanks.Hi
I don't know of a way to do this other than stop the services for the SQL
2005 instance of APP_DB and install a new instance. You can detach/attach
from one instance to the other. This is not going to save you much and will
use up disc space.
John
"q_test" <jluost1@.yahoo.com> wrote in message
news:4443EC3F.7080901@.yahoo.com...
>I have a machine with both SQL Server 2000 and SQL Server 2005. I found out
>that I cannot use an instance name for SQL Server 2000 that has already
>been used by SQL Server 2005.
> I need to rename the instance named "APP_DB" in SQL Server 2005 to be
> "APP_DB05", and use "APP_DB" for SQL Server 2000. That way I don't have to
> uninstall "APP_DB" from SQL Server 2005 because I need it in the future.
> So, how to rename an instance? Thanks.
>sql

how to rename a temp table

EXEC sp_rename '#customers', '#custs'
result with error :Invalid object name '#customers'.
how to rename a temp table?Sam
sp_rename
Changes the name of a user-created object (for example, table, column, or
user-defined data type) in the current database.
"Sam" <focus10@.zahav.net.il> wrote in message
news:ecE3BxurFHA.2008@.TK2MSFTNGP10.phx.gbl...
> EXEC sp_rename '#customers', '#custs'
> result with error :Invalid object name '#customers'.
> how to rename a temp table?
>
>|||Sam wrote:
> EXEC sp_rename '#customers', '#custs'
> result with error :Invalid object name '#customers'.
> how to rename a temp table?
I'm not sure you can rename a temporary table. Why do you need to do
this?
David Gugick
Quest Software
www.imceda.com
www.quest.com|||so how can i rename the temp table?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OziOz4urFHA.240@.tk2msftngp13.phx.gbl...
> Sam
> sp_rename
> Changes the name of a user-created object (for example, table, column, or
> user-defined data type) in the current database.
>
>
>
> "Sam" <focus10@.zahav.net.il> wrote in message
> news:ecE3BxurFHA.2008@.TK2MSFTNGP10.phx.gbl...
>|||I don't think there's a documented way to do it.
Why would you ever want to rename a temp table? This seems especially
pointless with a local temp table, which after all is intended
precisely to give you a locally-scoped name for the table. I'm sure if
you explain your requirement we can suggest a better solution to avoid
doing this.
David Portas
SQL Server MVP
--|||Uri, I believe sp_rename disallows renaming temp objects.
Hope this helps.
Dan Guzman
SQL Server MVP
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OziOz4urFHA.240@.tk2msftngp13.phx.gbl...
> Sam
> sp_rename
> Changes the name of a user-created object (for example, table, column, or
> user-defined data type) in the current database.
>
>
>
> "Sam" <focus10@.zahav.net.il> wrote in message
> news:ecE3BxurFHA.2008@.TK2MSFTNGP10.phx.gbl...
>|||select * into #NewName from #OldName
drop table #OldName
--Brian
(Please reply to the newsgroups only.)
"Sam" <focus10@.zahav.net.il> wrote in message
news:uBSEB%23urFHA.1168@.TK2MSFTNGP11.phx.gbl...
> so how can i rename the temp table?
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OziOz4urFHA.240@.tk2msftngp13.phx.gbl...
>|||sp_rename renames the table in the current database. a temp table is created
in tempdb database and tempdb doesnt have sp_rename stored procedure.
the table gets deleted immediately after the session is closed, so why do u
want to
rename it
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---
"Sam" wrote:

> EXEC sp_rename '#customers', '#custs'
> result with error :Invalid object name '#customers'.
> how to rename a temp table?
>
>
>|||Hi, Dan
That was exactly may point.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:OpFv7%23urFHA.2540@.TK2MSFTNGP09.phx.gbl...
> Uri, I believe sp_rename disallows renaming temp objects.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OziOz4urFHA.240@.tk2msftngp13.phx.gbl...
>|||> how to rename a temp table?
What would be the point?

How to rename a table ?

Hi all.

I'm porting an application from eVB-ADOCE to VB.Net-SQL CE

In the old application there are some SQL statements like this:

"ALTER TABLE OldTable TO NewTable"

Is there an equivalent instruction or a simple way to rename a table?

I was not able to find anything simple to do the same.

I really need NOT to do something like

SELECT * INTO NewTable FROM OldTable

because the resulting table could go outside memory and/or spend too much time in elaboration.

Please let me know what I can do.

Many thanks !

As far as I know, there is no such option from SQL. But you can rename a table (and a table column) using OLE DB:

QA: How do I rename a SQL CE table?

|||This is very interesting, and I read your article, but I'm so ignorant in C++ that I've not been able to translate your code in VB. |||

Don't worry - I'm working on an article that will allow you to do this from .NET CF on a device. I will post this article either today or tomorrow.

|||

Jo?o Paulo Figueira wrote:

Don't worry - I'm working on an article that will allow you to do this from .NET CF on a device. I will post this article either today or tomorrow.

That will be wonderful !

|||

As promised, here is the article:

Renaming a SQL CE Table From a .NET CF Application

|||

Joao Paulo,

I don't know how to say "thank you" for your kindness. I'm going to use your work just now.

If you come to Milano (Italy), please let me know ! I shall organize a good dinner for you

Thank you very much again !

How to rename a Olap Cube (AS2000)

I would like copy an existing production cube to a test environnment in the same server by changing the destination name.

I found nothing to rename the cube before archive or during the restore.

Changing the name of the archive does not change the restauration name.

Hi Georges

Copy and paste the cube with a new name (right click) then reload the cube.

Chris

How to rename a file in SSIS

I want to rename a file that is a variable to a fixed file name in a specific folder in SQL Server System Integration Services using the File System Task Editor.

Example: File1.txt to Users.txt or File2 to Users.txt. The source file is a variable the destination file is not. Here is an example of the File System Task Editor

HOW DO I SPECIFY A FIXED OR VARIABLE FOLDER NAME WITH A SPECIFIC FILE NAME???

File System Task Editor

Properties Value

Destination Connection
IsDestinationPathVariable True
DestinationVariable User::ArchivePath
OverWriteDestination True

General
Name Rename a file
Description File System Task

Operation
Operation Rename file

Source Connection
IsSourcePathVariable True
SourceVariable User::ImportFilePath

Thanks

There is more than one way to do it, the last link is run by DTS/SSIS experts you will find most of what you need. Hope this helps.

http://blogs.conchango.com/jamiethomson/archive/2005/09/14/2149.aspx

http://msdn2.microsoft.com/en-us/library/ms140185.aspx

http://www.sqlis.com

How to rename a database?

hi

every time I try to rename my database I face an error

I want to rename the database file phisically not just changing logigal name with

Alter Database <database name> modify name command

please step by step tell me what to do

whether with using TSql or Managment Studio

thanks

detach the database

rename the files

then "attach as" new database name

sql

How to rename a database?

hi

every time I try to rename my database I face an error

I want to rename the database file phisically not just changing logigal name with

Alter Database <database name> modify name command

please step by step tell me what to do

whether with TSql or Managment Studio

thanks

Workaround.

1. Deattach database files.
2. Rename physical files.
3. Attaching database files again and specify names you want.

you can do all this from SQL Management Studio 2005.

- Jignesh Desai

|||

Best way to do bit Your problem:

Use command:

sp_renamedb <old_name>, <new_name>

That's all. ;)

How to rename a database?

hi

I want to rename the phisical file of the dabase for instance rename <MyDatabase.mdf> to <Renameddatabase.mdf>

every time I do so whether directly renamin the file or by

using Alter Database command I face an error

note that I don't want to logically rename the database

please tell me step by step what to do

thanks in advance

Easiest way is to take a backup of your existing database and restore it with renaming the mdf files. Have you read the books online (help file)?

Are any users (other than yourself) connected to the database while you try to rename the file?

ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name , FILENAME = 'new_path\os_file_name' )Have you tried this command?

How to rename a database without detaching it?

Hello,
Is there an SP for renaming a database without detaching it? Or is there a
method or feature in Enterprise Manager for doing this? How can I do this?
Thanks,
RichYou can use the ALTER DATABASE or the (older technique) sp_renamedb.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rich" <Rich@.discussions.microsoft.com> wrote in message
news:0F20173D-603E-489B-AB85-6E789F924192@.microsoft.com...
> Hello,
> Is there an SP for renaming a database without detaching it? Or is there
a
> method or feature in Enterprise Manager for doing this? How can I do this
?
> Thanks,
> Rich
>|||try this.. not sure of the syntax though :)
alter database <old_db_name> modify name <new_db_name>|||Look up sp_renamedb in Books Online.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Rich" <Rich@.discussions.microsoft.com> wrote in message
news:0F20173D-603E-489B-AB85-6E789F924192@.microsoft.com...
> Hello,
> Is there an SP for renaming a database without detaching it? Or is there
> a
> method or feature in Enterprise Manager for doing this? How can I do
> this?
> Thanks,
> Rich
>|||small change.. sorry abt that
alter database <old_db_name> modify name = <new_db_name>
--
"Omnibuzz" wrote:

> try this.. not sure of the syntax though :)
> alter database <old_db_name> modify name <new_db_name>
>|||Thank you all for your replies. My problem has been solved.
"Rich" wrote:

> Hello,
> Is there an SP for renaming a database without detaching it? Or is there
a
> method or feature in Enterprise Manager for doing this? How can I do this
?
> Thanks,
> Rich
>

How to rename a database

As caption, how to rename a database?sp_renamedb
It is documented in SQL Book Online :- tsqlref.chm::/ts_sp_ra-rz_3yle.htm
HTH. Ryan
"kei" <kei@.discussions.microsoft.com> wrote in message
news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
> As caption, how to rename a database?|||Also, as of SQL Server 2000, it is recommended to rename a database using AL
TER DATABASE (although
sp_renamedb still exists and is supported).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
> sp_renamedb
> It is documented in SQL Book Online :- tsqlref.chm::/ts_sp_ra-rz_3yle.htm
> --
> HTH. Ryan
> "kei" <kei@.discussions.microsoft.com> wrote in message
> news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
>|||sp_helptext 'sp_renamedb', will give you clear picture of what sp_rename DB
does.
Its "Alter Database" itself whats hapenning inside sp_renamedb
Thanks,
Sree
"Tibor Karaszi" wrote:

> Also, as of SQL Server 2000, it is recommended to rename a database using
ALTER DATABASE (although
> sp_renamedb still exists and is supported).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
> news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
>|||> Its "Alter Database" itself whats hapenning inside sp_renamedb
It's true that sp_renamedb is basically just a wrapper for ALTER DATABASE so
you might as well eliminate the middle man and execute the command directly.
sp_renamedb will be removed in a future version of SQL Server.
Hope this helps.
Dan Guzman
SQL Server MVP
"Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
news:16C5441C-5988-4B95-AD97-A05184B4964F@.microsoft.com...[vbcol=seagreen]
> sp_helptext 'sp_renamedb', will give you clear picture of what sp_rename
> DB
> does.
> Its "Alter Database" itself whats hapenning inside sp_renamedb
> Thanks,
> Sree
> "Tibor Karaszi" wrote:
>|||I agree with what you're saying, however i was surprised to see that BOL
suggests the opposite..
BOL - ALTER DATABASE
Remarks
To remove a database, use DROP DATABASE. To rename a database, use
sp_renamedb. For more information about decreasing the size of a database,
see DBCC SHRINKDATABASE.
tsqlref.chm::/ts_aa-az_4e5h.htm
HTH. Ryan
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:OTlRGkCHGHA.3728@.tk2msftngp13.phx.gbl...
> It's true that sp_renamedb is basically just a wrapper for ALTER DATABASE
> so you might as well eliminate the middle man and execute the command
> directly. sp_renamedb will be removed in a future version of SQL Server.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
> news:16C5441C-5988-4B95-AD97-A05184B4964F@.microsoft.com...
>|||>I agree with what you're saying, however i was surprised to see that BOL
>suggests the opposite..
It appears you are using the original RTM version of the SQL 2000 BOL rather
than the latest update. You can download the latest reference from
http://www.microsoft.com/downloads/...DisplayLang=en.
Here's what the latest SQL Server BOL says:
<Excerpt BOL=SQL2000" href="http://links.10026.com/?link=tsqlref.chm::/ts_aa-az_4e5h.htm">
To remove a database, use DROP DATABASE. To rename a database, use the
MODIFY NAME = new_dbname option with ALTER DATABASE. For more information
about decreasing the size of a database, see DBCC SHRINKDATABASE.
</Excerpt>
Also, from the SQL Server 2005 BOL.
<Excerpt BOL=SQL2005"
href="ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/7dd9d4ff-20e1-4857
-9a8e-a5bff767cf76.htm">
Important:
This feature will be removed in a future version of Microsoft SQL Server.
Avoid using this feature in new development work, and plan to modify
applications that currently use this feature. Use ALTER DATABASE MODIFY NAME
instead. For more information, see ALTER DATABASE (Transact-SQL).
</Excerpt>
Even though you can still use sp_renamedb in SQL 2000 and SQL 2005, I think
it's best to break old habits.
Hope this helps.
Dan Guzman
SQL Server MVP
"Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:OLGYbqCHGHA.3936@.TK2MSFTNGP12.phx.gbl...
>I agree with what you're saying, however i was surprised to see that BOL
>suggests the opposite..
> BOL - ALTER DATABASE
> Remarks
> To remove a database, use DROP DATABASE. To rename a database, use
> sp_renamedb. For more information about decreasing the size of a database,
> see DBCC SHRINKDATABASE.
>
> tsqlref.chm::/ts_aa-az_4e5h.htm
>
> --
> HTH. Ryan
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:OTlRGkCHGHA.3728@.tk2msftngp13.phx.gbl...
>|||You're correct... I'm on a loaner PC today, i assumed it had the BOL
update - it doesn't...
Thanks
HTH. Ryan
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:ek6mwNDHGHA.208@.tk2msftngp13.phx.gbl...
> It appears you are using the original RTM version of the SQL 2000 BOL
> rather than the latest update. You can download the latest reference from
> http://www.microsoft.com/downloads/...DisplayLang=en.
> Here's what the latest SQL Server BOL says:
> <Excerpt BOL=SQL2000" href="http://links.10026.com/?link=tsqlref.chm::/ts_aa-az_4e5h.htm">
> To remove a database, use DROP DATABASE. To rename a database, use the
> MODIFY NAME = new_dbname option with ALTER DATABASE. For more information
> about decreasing the size of a database, see DBCC SHRINKDATABASE.
> </Excerpt>
> Also, from the SQL Server 2005 BOL.
> <Excerpt BOL=SQL2005"
> href="http://links.10026.com/?link=ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/7dd9d4ff-20e1-48
57-9a8e-a5bff767cf76.htm">
> Important:
> This feature will be removed in a future version of Microsoft SQL Server.
> Avoid using this feature in new development work, and plan to modify
> applications that currently use this feature. Use ALTER DATABASE MODIFY
> NAME instead. For more information, see ALTER DATABASE (Transact-SQL).
> </Excerpt>
> Even though you can still use sp_renamedb in SQL 2000 and SQL 2005, I
> think it's best to break old habits.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
> news:OLGYbqCHGHA.3936@.TK2MSFTNGP12.phx.gbl...
>

How to rename a database

As caption, how to rename a database?sp_renamedb
It is documented in SQL Book Online :- tsqlref.chm::/ts_sp_ra-rz_3yle.htm
--
HTH. Ryan
"kei" <kei@.discussions.microsoft.com> wrote in message
news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
> As caption, how to rename a database?|||Also, as of SQL Server 2000, it is recommended to rename a database using ALTER DATABASE (although
sp_renamedb still exists and is supported).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
> sp_renamedb
> It is documented in SQL Book Online :- tsqlref.chm::/ts_sp_ra-rz_3yle.htm
> --
> HTH. Ryan
> "kei" <kei@.discussions.microsoft.com> wrote in message
> news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
>> As caption, how to rename a database?
>|||sp_helptext 'sp_renamedb', will give you clear picture of what sp_rename DB
does.
Its "Alter Database" itself whats hapenning inside sp_renamedb
Thanks,
Sree
"Tibor Karaszi" wrote:
> Also, as of SQL Server 2000, it is recommended to rename a database using ALTER DATABASE (although
> sp_renamedb still exists and is supported).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
> news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
> > sp_renamedb
> >
> > It is documented in SQL Book Online :- tsqlref.chm::/ts_sp_ra-rz_3yle.htm
> >
> > --
> > HTH. Ryan
> > "kei" <kei@.discussions.microsoft.com> wrote in message
> > news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
> >> As caption, how to rename a database?
> >
> >
>|||> Its "Alter Database" itself whats hapenning inside sp_renamedb
It's true that sp_renamedb is basically just a wrapper for ALTER DATABASE so
you might as well eliminate the middle man and execute the command directly.
sp_renamedb will be removed in a future version of SQL Server.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
news:16C5441C-5988-4B95-AD97-A05184B4964F@.microsoft.com...
> sp_helptext 'sp_renamedb', will give you clear picture of what sp_rename
> DB
> does.
> Its "Alter Database" itself whats hapenning inside sp_renamedb
> Thanks,
> Sree
> "Tibor Karaszi" wrote:
>> Also, as of SQL Server 2000, it is recommended to rename a database using
>> ALTER DATABASE (although
>> sp_renamedb still exists and is supported).
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
>> news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
>> > sp_renamedb
>> >
>> > It is documented in SQL Book Online :-
>> > tsqlref.chm::/ts_sp_ra-rz_3yle.htm
>> >
>> > --
>> > HTH. Ryan
>> > "kei" <kei@.discussions.microsoft.com> wrote in message
>> > news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
>> >> As caption, how to rename a database?
>> >
>> >
>>|||I agree with what you're saying, however i was surprised to see that BOL
suggests the opposite..
BOL - ALTER DATABASE
Remarks
To remove a database, use DROP DATABASE. To rename a database, use
sp_renamedb. For more information about decreasing the size of a database,
see DBCC SHRINKDATABASE.
tsqlref.chm::/ts_aa-az_4e5h.htm
HTH. Ryan
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:OTlRGkCHGHA.3728@.tk2msftngp13.phx.gbl...
>> Its "Alter Database" itself whats hapenning inside sp_renamedb
> It's true that sp_renamedb is basically just a wrapper for ALTER DATABASE
> so you might as well eliminate the middle man and execute the command
> directly. sp_renamedb will be removed in a future version of SQL Server.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
> news:16C5441C-5988-4B95-AD97-A05184B4964F@.microsoft.com...
>> sp_helptext 'sp_renamedb', will give you clear picture of what sp_rename
>> DB
>> does.
>> Its "Alter Database" itself whats hapenning inside sp_renamedb
>> Thanks,
>> Sree
>> "Tibor Karaszi" wrote:
>> Also, as of SQL Server 2000, it is recommended to rename a database
>> using ALTER DATABASE (although
>> sp_renamedb still exists and is supported).
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
>> news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
>> > sp_renamedb
>> >
>> > It is documented in SQL Book Online :-
>> > tsqlref.chm::/ts_sp_ra-rz_3yle.htm
>> >
>> > --
>> > HTH. Ryan
>> > "kei" <kei@.discussions.microsoft.com> wrote in message
>> > news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
>> >> As caption, how to rename a database?
>> >
>> >
>>
>|||>I agree with what you're saying, however i was surprised to see that BOL
>suggests the opposite..
It appears you are using the original RTM version of the SQL 2000 BOL rather
than the latest update. You can download the latest reference from
http://www.microsoft.com/downloads/details.aspx?FamilyID=a6f79cb1-a420-445f-8a4b-bd77a7da194b&DisplayLang=en.
Here's what the latest SQL Server BOL says:
<Excerpt BOL=SQL2000" href="http://links.10026.com/?link=tsqlref.chm::/ts_aa-az_4e5h.htm">
To remove a database, use DROP DATABASE. To rename a database, use the
MODIFY NAME = new_dbname option with ALTER DATABASE. For more information
about decreasing the size of a database, see DBCC SHRINKDATABASE.
</Excerpt>
Also, from the SQL Server 2005 BOL.
<Excerpt BOL=SQL2005"
href="ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/7dd9d4ff-20e1-4857-9a8e-a5bff767cf76.htm">
Important:
This feature will be removed in a future version of Microsoft SQL Server.
Avoid using this feature in new development work, and plan to modify
applications that currently use this feature. Use ALTER DATABASE MODIFY NAME
instead. For more information, see ALTER DATABASE (Transact-SQL).
</Excerpt>
Even though you can still use sp_renamedb in SQL 2000 and SQL 2005, I think
it's best to break old habits.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:OLGYbqCHGHA.3936@.TK2MSFTNGP12.phx.gbl...
>I agree with what you're saying, however i was surprised to see that BOL
>suggests the opposite..
> BOL - ALTER DATABASE
> Remarks
> To remove a database, use DROP DATABASE. To rename a database, use
> sp_renamedb. For more information about decreasing the size of a database,
> see DBCC SHRINKDATABASE.
>
> tsqlref.chm::/ts_aa-az_4e5h.htm
>
> --
> HTH. Ryan
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:OTlRGkCHGHA.3728@.tk2msftngp13.phx.gbl...
>> Its "Alter Database" itself whats hapenning inside sp_renamedb
>> It's true that sp_renamedb is basically just a wrapper for ALTER DATABASE
>> so you might as well eliminate the middle man and execute the command
>> directly. sp_renamedb will be removed in a future version of SQL Server.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
>> news:16C5441C-5988-4B95-AD97-A05184B4964F@.microsoft.com...
>> sp_helptext 'sp_renamedb', will give you clear picture of what sp_rename
>> DB
>> does.
>> Its "Alter Database" itself whats hapenning inside sp_renamedb
>> Thanks,
>> Sree
>> "Tibor Karaszi" wrote:
>> Also, as of SQL Server 2000, it is recommended to rename a database
>> using ALTER DATABASE (although
>> sp_renamedb still exists and is supported).
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
>> news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
>> > sp_renamedb
>> >
>> > It is documented in SQL Book Online :-
>> > tsqlref.chm::/ts_sp_ra-rz_3yle.htm
>> >
>> > --
>> > HTH. Ryan
>> > "kei" <kei@.discussions.microsoft.com> wrote in message
>> > news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
>> >> As caption, how to rename a database?
>> >
>> >
>>
>>
>|||You're correct... I'm on a loaner PC today, i assumed it had the BOL
update - it doesn't...
Thanks
--
HTH. Ryan
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:ek6mwNDHGHA.208@.tk2msftngp13.phx.gbl...
> >I agree with what you're saying, however i was surprised to see that BOL
> >suggests the opposite..
> It appears you are using the original RTM version of the SQL 2000 BOL
> rather than the latest update. You can download the latest reference from
> http://www.microsoft.com/downloads/details.aspx?FamilyID=a6f79cb1-a420-445f-8a4b-bd77a7da194b&DisplayLang=en.
> Here's what the latest SQL Server BOL says:
> <Excerpt BOL=SQL2000" href="http://links.10026.com/?link=tsqlref.chm::/ts_aa-az_4e5h.htm">
> To remove a database, use DROP DATABASE. To rename a database, use the
> MODIFY NAME = new_dbname option with ALTER DATABASE. For more information
> about decreasing the size of a database, see DBCC SHRINKDATABASE.
> </Excerpt>
> Also, from the SQL Server 2005 BOL.
> <Excerpt BOL=SQL2005"
> href="http://links.10026.com/?link=ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/7dd9d4ff-20e1-4857-9a8e-a5bff767cf76.htm">
> Important:
> This feature will be removed in a future version of Microsoft SQL Server.
> Avoid using this feature in new development work, and plan to modify
> applications that currently use this feature. Use ALTER DATABASE MODIFY
> NAME instead. For more information, see ALTER DATABASE (Transact-SQL).
> </Excerpt>
> Even though you can still use sp_renamedb in SQL 2000 and SQL 2005, I
> think it's best to break old habits.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
> news:OLGYbqCHGHA.3936@.TK2MSFTNGP12.phx.gbl...
>>I agree with what you're saying, however i was surprised to see that BOL
>>suggests the opposite..
>> BOL - ALTER DATABASE
>> Remarks
>> To remove a database, use DROP DATABASE. To rename a database, use
>> sp_renamedb. For more information about decreasing the size of a
>> database, see DBCC SHRINKDATABASE.
>>
>> tsqlref.chm::/ts_aa-az_4e5h.htm
>>
>> --
>> HTH. Ryan
>> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
>> news:OTlRGkCHGHA.3728@.tk2msftngp13.phx.gbl...
>> Its "Alter Database" itself whats hapenning inside sp_renamedb
>> It's true that sp_renamedb is basically just a wrapper for ALTER
>> DATABASE so you might as well eliminate the middle man and execute the
>> command directly. sp_renamedb will be removed in a future version of SQL
>> Server.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
>> news:16C5441C-5988-4B95-AD97-A05184B4964F@.microsoft.com...
>> sp_helptext 'sp_renamedb', will give you clear picture of what
>> sp_rename DB
>> does.
>> Its "Alter Database" itself whats hapenning inside sp_renamedb
>> Thanks,
>> Sree
>> "Tibor Karaszi" wrote:
>> Also, as of SQL Server 2000, it is recommended to rename a database
>> using ALTER DATABASE (although
>> sp_renamedb still exists and is supported).
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
>> news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
>> > sp_renamedb
>> >
>> > It is documented in SQL Book Online :-
>> > tsqlref.chm::/ts_sp_ra-rz_3yle.htm
>> >
>> > --
>> > HTH. Ryan
>> > "kei" <kei@.discussions.microsoft.com> wrote in message
>> > news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
>> >> As caption, how to rename a database?
>> >
>> >
>>
>>
>>
>sql

How to rename a database

As caption, how to rename a database?
sp_renamedb
It is documented in SQL Book Online :- tsqlref.chm::/ts_sp_ra-rz_3yle.htm
HTH. Ryan
"kei" <kei@.discussions.microsoft.com> wrote in message
news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
> As caption, how to rename a database?
|||Also, as of SQL Server 2000, it is recommended to rename a database using ALTER DATABASE (although
sp_renamedb still exists and is supported).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
> sp_renamedb
> It is documented in SQL Book Online :- tsqlref.chm::/ts_sp_ra-rz_3yle.htm
> --
> HTH. Ryan
> "kei" <kei@.discussions.microsoft.com> wrote in message
> news:65DE5F9E-A2DC-44B6-B3BC-06A0EDAFF7FC@.microsoft.com...
>
|||sp_helptext 'sp_renamedb', will give you clear picture of what sp_rename DB
does.
Its "Alter Database" itself whats hapenning inside sp_renamedb
Thanks,
Sree
"Tibor Karaszi" wrote:

> Also, as of SQL Server 2000, it is recommended to rename a database using ALTER DATABASE (although
> sp_renamedb still exists and is supported).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
> news:%23kAEKBBHGHA.1288@.TK2MSFTNGP09.phx.gbl...
>
|||> Its "Alter Database" itself whats hapenning inside sp_renamedb
It's true that sp_renamedb is basically just a wrapper for ALTER DATABASE so
you might as well eliminate the middle man and execute the command directly.
sp_renamedb will be removed in a future version of SQL Server.
Hope this helps.
Dan Guzman
SQL Server MVP
"Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
news:16C5441C-5988-4B95-AD97-A05184B4964F@.microsoft.com...[vbcol=seagreen]
> sp_helptext 'sp_renamedb', will give you clear picture of what sp_rename
> DB
> does.
> Its "Alter Database" itself whats hapenning inside sp_renamedb
> Thanks,
> Sree
> "Tibor Karaszi" wrote:
|||I agree with what you're saying, however i was surprised to see that BOL
suggests the opposite..
BOL - ALTER DATABASE
Remarks
To remove a database, use DROP DATABASE. To rename a database, use
sp_renamedb. For more information about decreasing the size of a database,
see DBCC SHRINKDATABASE.
tsqlref.chm::/ts_aa-az_4e5h.htm
HTH. Ryan
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:OTlRGkCHGHA.3728@.tk2msftngp13.phx.gbl...
> It's true that sp_renamedb is basically just a wrapper for ALTER DATABASE
> so you might as well eliminate the middle man and execute the command
> directly. sp_renamedb will be removed in a future version of SQL Server.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
> news:16C5441C-5988-4B95-AD97-A05184B4964F@.microsoft.com...
>
|||>I agree with what you're saying, however i was surprised to see that BOL
>suggests the opposite..
It appears you are using the original RTM version of the SQL 2000 BOL rather
than the latest update. You can download the latest reference from
http://www.microsoft.com/downloads/d...isplayLang=en.
Here's what the latest SQL Server BOL says:
<Excerpt BOL=SQL2000" href="http://links.10026.com/?link=tsqlref.chm::/ts_aa-az_4e5h.htm">
To remove a database, use DROP DATABASE. To rename a database, use the
MODIFY NAME = new_dbname option with ALTER DATABASE. For more information
about decreasing the size of a database, see DBCC SHRINKDATABASE.
</Excerpt>
Also, from the SQL Server 2005 BOL.
<Excerpt BOL=SQL2005"
href="ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/7dd9d4ff-20e1-4857-9a8e-a5bff767cf76.htm">
Important:
This feature will be removed in a future version of Microsoft SQL Server.
Avoid using this feature in new development work, and plan to modify
applications that currently use this feature. Use ALTER DATABASE MODIFY NAME
instead. For more information, see ALTER DATABASE (Transact-SQL).
</Excerpt>
Even though you can still use sp_renamedb in SQL 2000 and SQL 2005, I think
it's best to break old habits.
Hope this helps.
Dan Guzman
SQL Server MVP
"Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:OLGYbqCHGHA.3936@.TK2MSFTNGP12.phx.gbl...
>I agree with what you're saying, however i was surprised to see that BOL
>suggests the opposite..
> BOL - ALTER DATABASE
> Remarks
> To remove a database, use DROP DATABASE. To rename a database, use
> sp_renamedb. For more information about decreasing the size of a database,
> see DBCC SHRINKDATABASE.
>
> tsqlref.chm::/ts_aa-az_4e5h.htm
>
> --
> HTH. Ryan
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:OTlRGkCHGHA.3728@.tk2msftngp13.phx.gbl...
>
|||You're correct... I'm on a loaner PC today, i assumed it had the BOL
update - it doesn't...
Thanks
HTH. Ryan
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:ek6mwNDHGHA.208@.tk2msftngp13.phx.gbl...
> It appears you are using the original RTM version of the SQL 2000 BOL
> rather than the latest update. You can download the latest reference from
> http://www.microsoft.com/downloads/d...isplayLang=en.
> Here's what the latest SQL Server BOL says:
> <Excerpt BOL=SQL2000" href="http://links.10026.com/?link=tsqlref.chm::/ts_aa-az_4e5h.htm">
> To remove a database, use DROP DATABASE. To rename a database, use the
> MODIFY NAME = new_dbname option with ALTER DATABASE. For more information
> about decreasing the size of a database, see DBCC SHRINKDATABASE.
> </Excerpt>
> Also, from the SQL Server 2005 BOL.
> <Excerpt BOL=SQL2005"
> href="http://links.10026.com/?link=ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/7dd9d4ff-20e1-4857-9a8e-a5bff767cf76.htm">
> Important:
> This feature will be removed in a future version of Microsoft SQL Server.
> Avoid using this feature in new development work, and plan to modify
> applications that currently use this feature. Use ALTER DATABASE MODIFY
> NAME instead. For more information, see ALTER DATABASE (Transact-SQL).
> </Excerpt>
> Even though you can still use sp_renamedb in SQL 2000 and SQL 2005, I
> think it's best to break old habits.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ryan" <Ryan_Waight@.nospam.hotmail.com> wrote in message
> news:OLGYbqCHGHA.3936@.TK2MSFTNGP12.phx.gbl...
>