September 9, 2010  
  Register Login 
BLOGS
There are no categories in this blog.

SEARCH BLOG

BLOG ARCHIVE
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
Monthly
October, 2008
  SQL Server Blogs     



Your Ad Here

 

Emptying a file

The following example demonstrates the procedure for emptying a file so that it can be removed from the database. For the purposes of this example, a data file is first created and it is assumed that the file contains data.

http://msdn2.microsoft.com/en-us/library/ms189493.aspx

USE AdventureWorks;
GO
-- Create a data file and assume it contains data.
ALTER DATABASE AdventureWorks
ADD FILE (
    NAME = Test1data,
    FILENAME = 'C:\t1data.ndf',
    SIZE = 5MB
    );
GO
-- Empty the data file.
DBCC SHRINKFILE ('Test1data', EMPTYFILE);
GO
-- Remove the data file from the database.
ALTER DATABASE AdventureWorks
REMOVE FILE Test1data;
GO

Permalink |  Trackback
Location: BlogsAleksandar Tosic's BlogDatabase Files    
Posted by: Aleksandar Tosic Wednesday, October 15, 2008

Your name:
Title:
Comment:
Add Comment   Cancel 
Copyright 2007 by www.dballinks.com Terms Of Use Privacy Statement