1. Execute the below command to find the logical file names and their location in local folder:
USE <DB_NAME>
Execute SP_Helpfile
E.g., Use AdventureWorks
Execute SP_HelpFile
2. Command to shrink a database:
DBCC SHRINKDATBASE (AdventureWorks)
3. Command to Shrink Logical files (.MDF, .LDF):
If the MDF logical file name of AdventureWorks database is AdventureWorks_Data
Then the command is,
DBCC SHRINKFILE (AdventureWorks_Data)
USE <DB_NAME>
Execute SP_Helpfile
E.g., Use AdventureWorks
Execute SP_HelpFile
2. Command to shrink a database:
DBCC SHRINKDATBASE (AdventureWorks)
3. Command to Shrink Logical files (.MDF, .LDF):
If the MDF logical file name of AdventureWorks database is AdventureWorks_Data
Then the command is,
DBCC SHRINKFILE (AdventureWorks_Data)
No comments:
Post a Comment