ADS: New Database

Regardless of what tool we are using, SQL Server Management Studio or Azure Data Studio, the need to create new databases is always present. Using Transact SQL is an option in both tools.  What is not an option in both tools is to right click and to go “New Database”.  This has been in SSMS for many years, however it is NOT present in Azure Data Studio.

Below you can see what the menu options are when you right click on databases in SSMS.  The New Database option is right at the top.

 

Now lets move on to Azure Data Studio.  When you right click on a server you will have a number of options, including new query, refresh and disconnect.  What you do not see is “Delete Database”.

As with a great deal of functionality in Azure Data Studio, the ability to right click on a server and create a new database comes with the installation of an extension.  In this case the extension was created by Keven Cunnane, It is pretty simple to install and cost the same as ADS, nothing.  This extension is currently not in “Preview” mode.  It is currently at version 1.0.0.

To install you will need to click the install button when looking at the extension documentation in Azure Data Studio.

Once you do, you will be taken to the location to download the .VSIX file.  You will need to download it and save to a location where it won’t be deleted or overwritten. To install, simply click on “Install Extension from .VSIX package” on the File menu.

Once you do you will see in the lower right corner that the extension has been installed.  A restart of Azure Data Studio is not required.  Now when you right click server, what do you see?  Well..you will see that nothing changed.  You will need to right click on Databases under the connection.

Once you click “New Database” you will not see the same dialog box you will see in SSMS.  What you will see is something like what is in the image below.  In the box you will enter the name of the new database.

Then hit enter and assuming you have the proper rights, ADS will create the database.  You will not be able to enter any of the settings we often change to accommodate the specific needs of the database or system.  This includes things like file location, recovery model, file growth rate and many more. With this, you will either need to use TSQL to adjust some of the settings or use SSMS.  This method of creating a database will depend on the defaults for all the settings.

Overall this is a good extension although it depends heavily on default database settings.  I still prefer to use TSQL when creating a database, however this is a nice simple method to use as well.

Here is a list of a number of available extensions, click here.  This list does not include all the extensions that are available but is still a nice list.

Thanks for visiting my blog!!