Open up Query Analyser and run the following, substituting real database, file and log names.
I’m using these names in the example:
Database name: [myDatabase]
Data file: [myDatabase_Data]
Log file: [myDatabase_Log]
SQL Code
Use Master
go
Backup Log [myDatabase] with truncate_only
go
Use [myDatabase]
go
DBCC shrinkfile ([myDatabase_Log], 2)
go
-- data
Use Master
go
Backup Log [myDatabase] with truncate_only
go
Use [myDatabase]
go
DBCC shrinkfile ([myDatabase_Data], 1)
go
-- Get fileid
use [myDatabase]
go
select * from sysfiles
No comments:
Post a Comment