When I installed Azure Data Studio connected to SQL version 2022 and wanted to restore advanturework 2022 for practice, there was no Restore data section when right-clicking on the Database, only Filter and Refresh sections. How to fix this error? SQL Se

a47777 Nguyễn Bá Hoàng 0 Reputation points
2024-05-16T17:20:43.4366667+00:00

When I installed Azure Data Studio connected to SQL version 2022 and wanted to restore advanturework 2022 for practice, there was no Restore data section when right-clicking on the Database, only Filter and Refresh sections. How to fix this error? SQL Server

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Alberto Morillo 33,086 Reputation points MVP
    2024-05-16T18:20:28.8066667+00:00

    As a workaround you can try to restore by opening a query window connected to the SQL Server 2022 instance and run the following Restore statement:

    USE [master]

    GO

    RESTORE DATABASE [AdventureWorks2022] FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Backup\AdventureWorks2022.bak' WITH FILE = 1, MOVE N'AdventureWorks2022' TO N'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\AdventureWorks2022.mdf', MOVE N'AdventureWorks2022_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\AdventureWorks2022_log.ldf', NOUNLOAD, REPLACE, STATS = 5

    GO

    Follow this tutorial to create to open a new query window.

    Replace this path "C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Backup\AdventureWorks2022.bak" with the actual path of the backup file. Or you can move the backup file to the suggested path.

    0 comments No comments

  2. Oury Ba-MSFT 16,901 Reputation points Microsoft Employee
    2024-05-17T17:36:08.0166667+00:00

    @a47777 Nguyễn Bá Hoàng Thank you for reachong out.

    In addition to @Alberto Morillo's answer. You could also do the following.

    To restore your database in Azure Data Studio, follow these steps:

    1. Download the appropriate .bak file from one of links provided in the download backup files section.
    2. Move the .bak file to your SQL Server backup location. This location varies depending on your installation location, instance name, and version of SQL Server. For example, the default location for a default instance of SQL Server 2022 (16.x) is: OutputCopy
         C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Backup
      
    3. Open Azure Data Studio and connect to your SQL Server instance.
    4. Right-click on your server and select Manage. Screenshot showing Azure Data Studio with the Manage option highlighted and called out.
    5. Select Restore Screenshot of selecting restore from the top menu to restore your database.
    6. On the General tab, fill in the values listed under Source.
      1. Under Restore from, select Backup file.
      2. Under Backup file path, select the location you stored the .bak file.
      Screenshot of selecting your backup file path. This step autopopulates the rest of the fields such as Database, Target database and Restore to. Screenshot of fields autopopulating.
    7. Select Restore to restore your database. Screenshot of restoring your database.

    Regards,

    Oury

    0 comments No comments