{"id":1793,"date":"2019-05-23T04:15:35","date_gmt":"2019-05-23T09:45:35","guid":{"rendered":"https:\/\/www.filerepairtools.com\/tips\/?p=1793"},"modified":"2019-05-23T04:15:35","modified_gmt":"2019-05-23T09:45:35","slug":"rename-a-sql-database-using-sql-server-management-studio","status":"publish","type":"post","link":"https:\/\/filerepairtools.com\/tips\/rename-a-sql-database-using-sql-server-management-studio\/","title":{"rendered":"How to Rename a SQL Database Using SQL Server Management Studio"},"content":{"rendered":"\n<p>SQL Database is one of the popular databases that is used by users worldwide. However, few problems may arise in SQL database due to corruption, sometimes renaming database could solve these problems to a major extent otherwise we need to <a href=\"https:\/\/www.filerepairtools.com\/sql-database-repair.html\">repair SQL Database<\/a> if renaming SQL database doesn&#8217;t solve the problem. Considering a situation like you backup database with a temporary name and the original database has a different name, so before restoring the database rename it to the original database. <\/p>\n\n\n\n<p>There are several methods to rename the database using Transact-SQL and SQL Server Management Studio, but it requires certain conditions. Before renaming the database it should be in single mode. So, the whole process is executed in two major steps<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Set Database to Single User Mode<\/li><li>Rename the database<\/li><\/ul>\n\n\n\n<p>Here we will learn how to set database to single user mode\nand rename it using SQL Server Management Studio<\/p>\n\n\n\n<p><strong>Points to Remember<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Single User Mode is to be set as if multiple users will be connected to the database then the actions performed on the database will interfere with the renaming process. Moreover, if a user executes the query on the old database name then it will not be processed.<\/li><li>User should have the permission for ALTER command to change the database name<\/li><li>To set and access the Single user mode in SQL database make sure <strong>AUTO_UPDATE_STATISTICS_ASYNC <\/strong>is set to OFF.<\/li><li>Make sure there is no external connection to SQL Database<\/li><\/ul>\n\n\n\n<p><strong>Set SQL Database to Single User Mode<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.filerepairtools.com\/tips\/wp-content\/uploads\/2019\/05\/sql-database-single-user-mode.png\" alt=\"sql database single user mode\" class=\"wp-image-1794\" width=\"384\" height=\"371\"\/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Start the SQL Server Management Studio<\/li><li>Open the Object Explorer, connect and expand instance of SQL Server Database Engine<\/li><li>Select the database, then right click on it and choose \u2018Properties\u2019<\/li><li>A new window will open, click on \u2018Options\u2019<\/li><li>From the Restrict Access Option, select \u2018Single\u2019<\/li><li>If other users are connected with database then Open Connections, change the property and close all other connections<\/li><li>Confirm Yes, the SQL server database will be set to single-user mode only<\/li><\/ul>\n\n\n\n<p>Now, once it is set\nto single user mode the database name can be changed easily by following method<\/p>\n\n\n\n<p><strong>Rename SQL Server Database<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.filerepairtools.com\/tips\/wp-content\/uploads\/2019\/05\/rename-sql-database.png\" alt=\"change sql database name\" class=\"wp-image-1795\"\/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Start SQL Server Management Studio and open Object explorer<\/li><li>Establish a connection with SQL instance<\/li><li>Click on the database of which you want to change the name <\/li><li>Right click on the database and click Rename<\/li><li>Type a new name to the database and then click OK<\/li><li>Exit SQL Server Management Studio<\/li><\/ul>\n\n\n\n<p>By following the\nabove steps the name of a SQL database can be changed and it can be used to\nperform other actions like database transfer or migration of tables, indexes\nand other components.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL Database is one of the popular databases that is used by users worldwide. However, few problems may arise in SQL database due to corruption, sometimes renaming database could solve these problems to a major extent otherwise we need to repair SQL Database if renaming SQL database doesn&#8217;t solve the problem. Considering a situation like [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2219,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1793","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-repair"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/wp\/v2\/posts\/1793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/wp\/v2\/comments?post=1793"}],"version-history":[{"count":0,"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/wp\/v2\/posts\/1793\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/wp\/v2\/media?parent=1793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/wp\/v2\/categories?post=1793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/filerepairtools.com\/tips\/wp-json\/wp\/v2\/tags?post=1793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}