Free cookie consent management tool by TermsFeed Policy Generator
  • Azure SQL Video
  •    37 page views
  •   4750 video views
  • 2024, March 02, Saturday

How to create Azure SQL Database in Azure Data Studio

We present how we can create a new Azure SQL Database using Azure Data Studio, this tool has proven to be a differential in the management of your SQL Server in the Cloud

We'll get to know the techniques:

1. How to create

a new SQL Server instance (Azure Portal):
  • Creating a new instance of SQL Server on Azure can be performed through the Azure Portal by following the steps below:

    • Go to Azure Portal.
    • In the left panel, click "Create a resource."
    • Search for "SQL Server" and select the option you want.
    • Fill in the required details such as name, authentication type, password, etc.
    • Configure advanced options if necessary.
    • Click "Review + Create" and then "Create" to begin the provisioning process.

2. Creating a new database via script (Python Kernel):

  • In Azure Data Studio, you can use a Python kernel to run scripts. Below is an example of a Python script to create a new database:

    # Using Python in Azure Data Studio
    # Connect to SQL Server
    server_name = 'ServerName'
    database_name = 'NewDatabase'
    
    conn_str = f'DRIVER=ODBC Driver 17 for SQL Server; SERVER={server_name}; DATABASE=master; Trusted_Connection=yes;'
    
    # Run SQL command to create database
    create_db_query = f'CREATE DATABASE {database_name};'
    
    # Run the command using the pyodbc library
    import pyodbc
    
    with pyodbc.connect(conn_str, autocommit=True) as connection:
        connection.execute(create_db_query)
    

3. How to identify database cost with the Azure Pricing Calculator:

4. Reduce cost by enabling the

database auto-pause function:
  • In Azure SQL Database, you can enable the auto-pause function to reduce costs when the database is not in use. This allows the database to be automatically paused during periods of inactivity and resumed when needed.

    • In the Azure portal, go to your SQL database settings.
    • Under "Feature Settings," find the "Pause Settings" section and enable the "Auto-pause" option.
    • Configure auto-pause options, such as pause delay and downtime.

These are general guidelines and the exact steps may vary based on specific versions of Azure Data Studio and Azure Portal configurations. Be sure to refer to the official documentation for more detailed information.

This content contains
  • Content Video
  • Language Portuguese
  • Duration 13m 23s
  • Subtitles Sim

  • Reading time 1 min 46 seg

avatar
Fabio Santos

Data Scientist and Consultant for Digital and Analytics Solutions


  • Share

Youtube Channel

@fabioms

Subscribe now