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.
| Author |
Topic |
|
aliyesami
Starting Member
30 Posts |
Posted - 2008-04-16 : 18:59:22
|
| I am trying to remove the transaction log file since I have created another one on a seperate drive by it wont let me do it . I get this error "cant delete the primary data or log file" Now microsoft site clearly state steps for deleting the transaction log file , by first emptying it and then deleting it BUT IT DOESNT WORK.I have even tried detaching the database and then removing the transaction log file and then attaching the database again BUT it attaches the transaction file back again GRRRRRRthen on top of this MS SQL studio does not allow to put PRIMARY or anyother value to the Filegroup for tansaction log files so how on earth can a transaction file be "primary" as the error is stating ??????can anyone tell me how to get rid of a transaction log file that was created with the database ? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-04-16 : 19:09:30
|
| Delete your new log file, detach the database, copy the LDF file to your separate drive, then reattach the database specifying both MDF and LDF, making sure to provide the new location.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
aliyesami
Starting Member
30 Posts |
Posted - 2008-04-16 : 20:26:38
|
| THANKS A LOT ! IT WORKED .how can MS get away with wrong documentation I wonder. This is what they have for deleting transaction log file :"Deleting a data or transaction log file removes the file from the database. You cannot remove a file from the database unless the file has no existing data or transaction log information; the file must be completely empty before it can be removed. To empty a data file by moving data from the data file to other files in the same filegroup, use the DBCC SHRINKFILE statement and specify the EMPTYFILE clause. Because the Database Engine no longer allows data to be placed on the file after the shrink operation, the empty file can be removed by using the ALTER DATABASE statement or SQL Server Management Studio" |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-04-16 : 23:20:35
|
| Could you post the article link from where you got this information?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
sql_1
Starting Member
1 Post |
Posted - 2010-05-01 : 10:50:48
|
| here is the link for SQL 2K8http://msdn.microsoft.com/en-us/library/ms191433.aspx |
 |
|
|
|
|
|