Monday, January 26, 2015

sql server shrink command

USE HOSPITAL_DB
 select name,recovery_model_desc from sys.databases
 ALTER DATABASE HOSPITAL_DB SET RECOVERY simple

 DBCC SHRINKFILE (CDCDataStore , 1)


 --get datafiles from database to use in shrinkfile dbcc command

SELECT file_id, name
FROM sys.database_files;

No comments:

Post a Comment