Friday, February 17, 2012

emptying data file and removing it

Using SS2000. File 1 was 6G and file 2 was 3.3G. Using dbcc shrinkfile
(file2id,emptyfile) I shrank file 2. After shrinking, file 1 was 7.1G but
file 2 was still 3.3G. I shrank the whole database in EM but the file sizes
were the same.
Is it safe to remove file 2 with alter database dns remove file
E:\sql\data\dns_data.mdf or is something wrong?
Thanks,
Dan D.
Yes, it is safe to remove file 2 using ALTER DATABASE REMOVE FILE. If the
file is not empty, ALTER DATABASE command will fail and you will get an
error.
Stephen Jiang
Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:381F2480-0556-40D2-9C2B-26F4694864D0@.microsoft.com...
> Using SS2000. File 1 was 6G and file 2 was 3.3G. Using dbcc shrinkfile
> (file2id,emptyfile) I shrank file 2. After shrinking, file 1 was 7.1G but
> file 2 was still 3.3G. I shrank the whole database in EM but the file
sizes
> were the same.
> Is it safe to remove file 2 with alter database dns remove file
> E:\sql\data\dns_data.mdf or is something wrong?
> Thanks,
> --
> Dan D.
|||We used the database yesterday and all of the data seemed to be there. We
also added data and only file1 changed size. The size of the file I emptied
was unchanged.
Thanks,
Dan D.
"Stephen Yuan Jiang [MSFT]" wrote:

> Yes, it is safe to remove file 2 using ALTER DATABASE REMOVE FILE. If the
> file is not empty, ALTER DATABASE command will fail and you will get an
> error.
> --
> Stephen Jiang
> Microsoft SQL Server Storage Engine
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:381F2480-0556-40D2-9C2B-26F4694864D0@.microsoft.com...
> sizes
>
>

No comments:

Post a Comment