Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 ask - can I change mdf and ldf and make as primary

Author  Topic 

neubie
Starting Member

21 Posts

Posted - 2008-11-26 : 22:42:23
hi there,
as my subject, can I change name (or file) transaction log and data log, which is primary log?
thanks

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-11-26 : 23:05:08
Is this related to this?
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=115276

While restoring database you can change name.
Go to Top of Page

neubie
Starting Member

21 Posts

Posted - 2008-11-27 : 00:37:47
yup..sorry if I made mistake, I think there are two different cases in one problem.

btw, I'd tried to change name for log file and its file, but can't be executed
Go to Top of Page

neubie
Starting Member

21 Posts

Posted - 2008-11-27 : 03:14:39
anyway, yes I can change name (if you refer to log name), but there is an error, in other words, I can change name, but sql don't recognize it.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2008-11-27 : 03:55:36
What are you trying to do? I don't understand your question.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-11-27 : 05:20:16
>> I can change name, but sql don't recognize it.
What do you mean by that?
Can you post what you have tried and what the problem was.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

neubie
Starting Member

21 Posts

Posted - 2008-11-27 : 23:47:17
ok, I think I have to explain all of story (progress) from beginning. then here we go:
I've created new database with named NEW. I want my backup-database from another database (let say OLD) to be restored for NEW.
"problem" occur in this step, name of log file has changed (eg. NEW_data become OLD_data).

Can I change it back?

thanks
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-11-28 : 00:58:20
have a look at alter database modify file

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

neubie
Starting Member

21 Posts

Posted - 2008-11-28 : 03:42:16
quote:
Originally posted by nr

have a look at alter database modify file

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.



what file? sorry, I'm really new.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2008-11-28 : 04:02:52
If you want to just change the logical name of a file, the syntax is ALTER DATABASE ... MODIFY FILE ...

Look up Alter Database in Books Online. The full syntax and all options are listed there.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

neubie
Starting Member

21 Posts

Posted - 2008-12-03 : 19:50:24
ok I'll try. thanks.
Go to Top of Page
   

- Advertisement -