Microsoft SQL Server Links
Links, articles, scripts, tips, and other technical sources for managing SQL Server. DBALinks is dedicated to SQL Server and database administration.
CHECK OUR BLOGS!
Click here to download SQL Server 2005 Express Version.
Truncating a data file
The following example truncates the primary data file in the AdventureWorks database. The sys.database_files catalog view is queried to obtain the file_id of the data file.
http://msdn2.microsoft.com/en-us/library/ms189493.aspx
USE AdventureWorks; GO SELECT file_id, name FROM sys.database_files; GO DBCC SHRINKFILE (1, TRUNCATEONLY);