{"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"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Reduce\/Shrink the SQL Server Database Size? - OWS KB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Reduce\/Shrink the SQL Server Database Size? - OWS KB\" \/>\n<meta property=\"og:description\" content=\"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;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-22T05:49:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-1-300x169.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"0 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"OWS KB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2021\/09\/shrink-1.png\",\"width\":1024,\"height\":578,\"caption\":\"shrink-1\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/#webpage\",\"url\":\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/\",\"name\":\"How to Reduce\/Shrink the SQL Server Database Size? - OWS KB\",\"isPartOf\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/#primaryimage\"},\"datePublished\":\"2021-09-22T05:49:16+00:00\",\"dateModified\":\"2021-09-22T05:49:16+00:00\",\"author\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"breadcrumb\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/how-to-reduce-shrink-the-sql-server-database-size\/\",\"name\":\"How to Reduce\/Shrink the SQL Server Database Size?\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ownwebservers.com\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_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}]}}