--Create the database. Notice the size of the filesCREATE DATABASE MyDBON ( NAME = MyDB_dat, FILENAME = 'c:\MyDB.mdf', SIZE = 10MB, MAXSIZE = 50, FILEGROWTH = 5 )LOG ON( NAME = MyDB_log, FILENAME = 'c:\MyDB.ldf', SIZE = 3MB, MAXSIZE = 25MB, FILEGROWTH = 5MB )gouse MyDBgo--Get the file's size select name, size from MyDB.sys.database_files--Srinking both log and data filesdbcc shrinkfile('MyDB_Dat',1)godbcc shrinkfile('MyDB_log',1)go--Compare the new size with the size before the use of dbcc shrinkfileselect name, size from MyDB.sys.database_filesgo--Cleanup the messuse mastergodrop database MyDB