{"id":2111,"date":"2021-09-22T05:49:16","date_gmt":"2021-09-22T05:49:16","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=2111"},"modified":"2021-09-22T05:49:16","modified_gmt":"2021-09-22T05:49:16","slug":"how-to-reduce-shrink-the-sql-server-database-size","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/","title":{"rendered":"How to Reduce\/Shrink the SQL Server Database Size?"},"content":{"rendered":"<h3>Method 1: Using SQL Server Management Studio<\/h3>\n<p>Follow the steps as given below to shrink or reduce the SQL Server database size (.MDF and .LDF).<\/p>\n<p><strong>Step 1:<\/strong>\u00a0Right-click on the database name &gt;&gt; Tasks &gt;&gt; Shrink &gt;&gt; Database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2112\" src=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-1-300x169.png\" alt=\"shrink-1\" width=\"1024\" height=\"578\" srcset=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-1-300x169.png 300w, https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-1-768x434.png 768w, https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-1.png 1024w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Step 2:\u00a0<\/strong>Then Click\u00a0<strong>OK<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2113\" src=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-2-300x172.png\" alt=\"shrink-2\" width=\"1024\" height=\"586\" srcset=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-2-300x172.png 300w, https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-2-768x440.png 768w, https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-2.png 1024w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h3>Method 2: Using Transact SQL Command<\/h3>\n<p>Follow the steps to shrink or reduce the SQL Server database size using SQL command.<\/p>\n<p><strong>Step 1:<\/strong>\u00a0Open\u00a0<strong>SQL Server Management Studio.<\/strong><\/p>\n<p><strong>Step 2:<\/strong>\u00a0Connect to the Database Engine.<\/p>\n<p><strong>Step 3:<\/strong>\u00a0From the Standard bar, click\u00a0<strong>New Query<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2114\" src=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-3-300x172.png\" alt=\"shrink-3\" width=\"1024\" height=\"586\" srcset=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-3-300x172.png 300w, https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-3-768x440.png 768w, https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-3.png 1024w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Step 4:<\/strong>\u00a0Type the following SQL command into the query window and click\u00a0<strong>Execute<\/strong>.<\/p>\n<pre>DBCC SHRINKDATABASE (DatabaseName, 'target percent')<\/pre>\n<p><em>\u2014 This command shrinks the test database<\/em><\/p>\n<p><em><strong>Example:<\/strong><\/em><\/p>\n<p>DBCC SHRINKDATABASE (test, 10);<\/p>\n<p>GO<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2115\" src=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-4-300x172.png\" alt=\"shrink-4\" width=\"1024\" height=\"586\" srcset=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-4-300x172.png 300w, https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-4-768x440.png 768w, https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-4.png 1024w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<article id=\"post-6489\" class=\"post-6489 post type-post status-publish format-standard hentry category-tutorials tag-reduce-sql-server-database-size tag-shrink-database-size tag-sql-server-database-size ast-article-single\">\n<div class=\"ast-post-format- ast-no-thumb single-layout-1\">\n<div class=\"entry-content clear\">\n<p>Now you have shrunk the database size successfully!<\/p>\n<\/div>\n<\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>Method 1: Using SQL Server Management Studio Follow the steps as given below to shrink or reduce the SQL Server database size (.MDF and .LDF). Step 1:\u00a0Right-click on the database name &gt;&gt; Tasks &gt;&gt; Shrink &gt;&gt; Database. Step 2:\u00a0Then Click\u00a0OK. Method 2: Using Transact SQL Command Follow the steps to shrink or reduce the SQL [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-2111","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/2111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=2111"}],"version-history":[{"count":1,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/2111\/revisions"}],"predecessor-version":[{"id":2116,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/2111\/revisions\/2116"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=2111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=2111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=2111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}