How do I rename an Azure SQL Database?

From time to time I need to do those kind of things, so I want to keep it posted here to no to forget them.

If I need to rename a database which is in Azure Database, I have two options to do this, bot options are related with Management Studio, so keep in min to have in your laptop and keep in mind that your IP has to be allowed to connect to the database server.

Rename with command-line – TSQL

  1. Connect with SQL Server Management Studio to your Azure database server
  2. Right-click on the master database and select New Query
  3. In the New Query window type ALTER DATABASE [dbname] MODIFY NAME = [newdbname]. (Make sure you include the square brackets around both database names.)

Rename with a GUI – SQL Server Management Studio

  1. Connect with SQL Server Management Studio
  2. Make sure Object Explorer pane is open.
  3. Click on the database name (as the rename option from the dropdown will be greyed out) and type in the new name.
  4. The Azure Portal should show the reflected the change almost immediately.

On-Premises Gateway

We are living in a digital transformation to O365, but by the time we are doing this, our customers still need to connect their On-Premises data like SharePoint or SQL to Office 365 applications (PowerApps, Microsoft Flow, Logic Apps, Power BI).

For that reason, Microsoft has introduced on-premises data gateway for providing a quick and secure connection between on premise data and Office 365 apps.

We must keep in mind that there are two different types of gateways, one of them is On-Premises and the other gateway, is the personal gateway, which only allows to connect to PowerBI and can be used as an individual without any administrator configuration.

In the following image, we can see the differences between the personal gateway and the On-Premises gateway:


Moreover, the current supported On-Premises applications are SharePoint 2016 and SQL 2016, as you can see in the diagram below, there are multiple O365 connections to On-Premises services:


The installation process is straightforward, and only is needed a server with the following requirement to use the gateway:

Hardware Requirements:

Hardware Requirements Value
CPU 8 Cores

Software Requirements:

Software Requirements Value
.NET Framework Version – 4.5
Operating System Windows 7 / Windows Server 2008 R2, or later

If you require more info about the gateway, you can follow the links:

How to restore local databases to Azure Databases

We are in involved in several projects with Azure, and in one of them, we need to create an Azure Database to use with an Application Web and restore some information that we have onPremises on Azure Databases.

So, as you can imagine, is it not possible to restore a OnPremises database to Azure, you have to do additional steps, so the goal of this post is to explain that process:

First, you’ll need to create a SQL Database in Azure:


Give a name for the database. Once it is created, you will see the servername listed in the dashboard:


So, we need to start the SQL Server Management Studio and connect to the Azure database, entering the server name and Login credentials:


In SQL Server Management Studio, will now be listed the database created:

Sin título

Next Step is to connect to the Local SQL server instance and generate the scripts:

Sin título1.png

The script generator will now start. In this instance I have selected to script the entire database


Before you create the script, click on the ‘Advanced’ button


Under the advanced options, be sure to select to script the database for SQL Azure


In my example, I chose to only script the schema but you can script the schema and or data


After you are done, create the script


Next step is to select Azure database in Management Studio and execute the script file you have previously generated


Hit f5…


After doing this, the schema will be created in the Azure database


Easy, isn’t it?