Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Name change on data files and transaction log 1

Status
Not open for further replies.

Aeros

Programmer
Oct 7, 2002
166
US
We had a developer who developed two databases that were identical but each for its own site. They created the first one and duplicated for the second site.

When he did this for DB2 he gave it a different database name and datafile that it points to. Now when I look under the DB2 properties in the 'Data Files' and 'Transaction Log' tabs the 'File Name' still says DB1 where it should be DB2. The actual location points to the new DB2.mdf and DB2.log files so thats fine.

I just dont know if the same 'File Name' for 2 different DB's will cause a problem or not...or is it possible to change the second one (preferable)

Thanks
 
The name of the file won't case any problems. However it's easy enough to change.
Code:
alter database DB2
modify file (name=db1_data, newname=db2_data)
go
alter database DB2
modify file (name=db1_log, newname=db2_log)
go
That's all there is to it.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top