Wednesday, March 7, 2012

Change the logical name....

How to change the logical name of the database?
SQL2K.
Thanks,
HarryThis is a multi-part message in MIME format.
--070401030300090800000309
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
exec sp_renamedb
<http://msdn.microsoft.com/library/en-us/tsqlref/ts_sp_ra-rz_3yle.asp>
'OldName', 'NewName'
--
*mike hodgson*
blog: http://sqlnerd.blogspot.com
HarrySmith wrote:
>How to change the logical name of the database?
>SQL2K.
>Thanks,
>Harry
>
>
--070401030300090800000309
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>exec <a
href="http://links.10026.com/?link=sp_renamedb</a>">http://msdn.microsoft.com/library/en-us/tsqlref/ts_sp_ra-rz_3yle.asp">sp_renamedb</a>
'OldName', 'NewName'</tt><br>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font></span> <b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"><br>
<font face="Tahoma" size="2">blog:</font><font face="Tahoma" size="2"> <a
href="http://links.10026.com/?link=http://sqlnerd.blogspot.com</a></font></span>">http://sqlnerd.blogspot.com">http://sqlnerd.blogspot.com</a></font></span>
</p>
</div>
<br>
<br>
HarrySmith wrote:
<blockquote cite="mid%2304iYpBtFHA.2348@.tk2msftngp13.phx.gbl"
type="cite">
<pre wrap="">How to change the logical name of the database?
SQL2K.
Thanks,
Harry
</pre>
</blockquote>
</body>
</html>
--070401030300090800000309--|||Hi Harry,
U can use sp_password for change of password
use sp_changedbowner for change of db owner
from
doller|||U can also use ep_renamedb
for user rename
from
doller|||U can also use sp_renamedb
for user rename
from
doller|||U can also use sp_renamedb
for user rename
from
doller|||Hi,
Looks like Harry asked to change the logical file name. For that you have to
ALTER DATABASE command.
Command is:-
ALTER DATABASE <DBNAME> modify file (NAME = 'old_MDF_NAME', NEWNAME ='NEW_MDF_NAME')
do the same for LDF file as well.
Note:
We can not change the logical file name in SQL 7. The command will only work
in SQL 2000.
THnaks
Hari
SQL Server MVP
"HarrySmith" <HarrySmith_56@.hotmail.com> wrote in message
news:%2304iYpBtFHA.2348@.tk2msftngp13.phx.gbl...
> How to change the logical name of the database?
> SQL2K.
> Thanks,
> Harry
>|||Yes. Hari's solution is the right one for my requirement. I did not try
other postings.
Thanks,
Harry
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23Fob8BCtFHA.3080@.TK2MSFTNGP15.phx.gbl...
> Hi,
>
> Looks like Harry asked to change the logical file name. For that you have
to
> ALTER DATABASE command.
> Command is:-
> ALTER DATABASE <DBNAME> modify file (NAME = 'old_MDF_NAME', NEWNAME => 'NEW_MDF_NAME')
>
> do the same for LDF file as well.
>
> Note:
> We can not change the logical file name in SQL 7. The command will only
work
> in SQL 2000.
> THnaks
> Hari
> SQL Server MVP
> "HarrySmith" <HarrySmith_56@.hotmail.com> wrote in message
> news:%2304iYpBtFHA.2348@.tk2msftngp13.phx.gbl...
> > How to change the logical name of the database?
> > SQL2K.
> > Thanks,
> > Harry
> >
> >
>

No comments:

Post a Comment