Backup users in Azure SQL Database - azure-sql-database

IN my scenario need to take azure sql database backup and restore in another azure sql database server.I have done it using Export and Import . But i need to take the backup of users from one DB to another with permissions.

You can use the script for creating a script that can be run on the exported/imported database to create users. Here is the script -
https://dba.stackexchange.com/questions/190475/scripting-out-database-user-level-permissions
If the need is to move the On premises Logins to Azure SQL DB:There is a utility to move On-Premises SQL Server Logins to Azure SQL DB.
This scenario is documented in the Data Migration Assistant guide
Hope this helps.
Thanks
Navtej S

Related

Run a query automatically SSMS without SQL server agent

I'm a new PowerBI developer.
I am inserting data from the Azure SQL database via SSMS.
I don't have access to a server agent for being able to create jobs.
I just want to run 4-5 queries (1 query = 1 step for my job). Is there a simple way to do this automatically for example?
Well, there's no server agent in Azure SQL DB, so you cannot create jobs as you do in on-prem or on Azure VM installations.
However, you do have Elastic jobs on Azure which can run queries on Azure SQL Database periodically.
See the documentation here.

SQL Azure database

Setting up SQL database API to create read update and delete Data in Azure
There is no such as SQL database API. We usually use REST API to manage the Azure SQL database.
You can create and manage servers and single databases in Azure SQL Database using the Azure portal, PowerShell, the Azure CLI, REST API, and Transact-SQL.
Choose the best one which is suitable for you.
Ref this document: Create and manage servers and single databases in Azure SQL Database

Can we migrate a Database from Azure Sql Database directly to Azure postgreSql Database

Is there a way to directly migrate your database in Azure SQL database to the Azure PostgreSQL database (HyperScale-Citus).
I have looked into the Azure migration services but it does not support this particular migration route.
I have an approach in mind but don't know if it will work?
We can make a backup of the Azure SQL database on the cloud itself
and then load that backup to Azure PostgreSQL database
But I do not where to make a backup. In azure blob storage or something else?
Frist way, you could try the tutorial #ffffff01 provided for you.
There this another way can help you achieve that: Data Factory can help you migrate the database/data from Azure SQL database to Azure PostgreSQL database directly.
Ref bellow tutorial:
Copy data to and from Azure Database for PostgreSQL by using Azure
Data Factory
Copy and transform data in Azure SQL Database by using Azure Data
Factory
Create Azure SQL database as source dataset and Azure PostgreSQL database as sink.
Hope this helps.

Migrate SQL Server database to Azure along with database email and jobs

I am new to SQL Azure, we have taken the subscription of Azure SQL elastic pool.
I have two databases in my local SQL Server and it has a stored procedure which internally is calling msdb.dbo.sp_send_dbmail and I have scheduled these stored procedures to run in a job (SQL Server Agent -> Scheduler).
I want to move these two databases along with DB-mail accounts and SQL Server jobs to Azure. I am finding difficulties as in my subscription I am not able to see msdb, SQL Server Agent and database email. We want to go with only SQL Azure as service, no need your support on these.
I tried to deploy the database and getting the error message:
Error
SQL71562: Error validating element [dbo].[AMPLoanAgingEMail]:
Procedure: [dbo].[AMPLoanAgingEMail] has an unresolved reference to object [msdb].[dbo].[sp_send_dbmail].[#profile_name]. External references are not supported when creating a package from this platform.
The expected result is I want to move those scheduled jobs and stored procedures to my Azure.
Azure SQL database doesn't support msdb database. We can not migrate msdb to Azure or do anything with it in Azure SQL database.
For more details, please see: msdb database.
SQL server agent is only supported Azure SQL Managed Instance only.
Database email also is not supported in Azure SQL Database.
This why you can not be able to see msdb , SQL server agent and database email.
Your stored procedure [dbo].[AMPLoanAgingEMail] could not call the [msdb].[dbo].[sp_send_dbmail] in msdb. The error message also mentioned that.
For now, there isn't a solution for msdb in Azrue SQL Database.
Before migrate your database to Azure SQL database, you can use Data Migration Assistant(DMA) to help you assess your database.
Hope this helps.

Create an Azure SQL DB from an external mssql backup file

I have a backup file of an mssql database using which I would like to create a database in Azure SQL.I see option for restoring a database in azure. But I dont find an option to create a database in Azure SQL from an external backup file.kindly advise.
The data import steps might not be same as how we restore an on premise sql database.
The Data can easily be restored from a azure backup in azure portal ( just import it into a new sql db).
For migrating an on-premise sql database to azure sql database Microsoft provides a tool DMA (Data Migration Assistant). This tool provides a wizard based step by step approach to connect to your on-premise sql database source , select the objects to migrate , generate a script , follow the migration progress and errors if any during the process.
A few changes might be required post migration in the Azure sql database to update the pricing tier , performance and compatibility level.
Here is a document demonstrating a step by step process to migrate an on-premise sql database to azure sql database - https://learn.microsoft.com/en-us/azure/sql-database/sql-database-migrate-your-sql-server-database