Sending emails from within Azure SQL Elastic Jobs steps - azure-sql-database

In Azure Elastic Jobs (preview) I am trying to find a way to send an email from within T_SQL in one of the job steps as msdb.dbo.sp_send_dbmail is not available in elastic Jobs. I have done some research and it appears there is no native support that i can find for achieving this and the only suggestion I have found so far is saving the jobs output to a table and then using something else (like PowerShell) to send the actual email.
Here is a link to an article explaining one way of achieving this and another here link.
Has anyone found a better solution to this?

Azure SQL database doesn't support msdb.dbo.sp_send_dbmail. That's why we must use other tools like PowerShell or logic app. Just for now, these are the solutions we can find and there isn't a better solution for now.
If you want use this feature, may you can choose Azure SQL managed instance or SQL Server in VMs.
HTH.

Related

How can i change Azure SQL online time

I want to set my database online/offline status. How can i do?
For example like monday-saturday time 06.00 - 21.00 set online, sunday offline
There's no default option in Azure SQL to accomplish your scanrio.
Howeever, you may able to do some workaround to get what you want or at least most of it.
For example:
you could leverage Azure SQL Serverless. A lot of considerations need to put here.
Azure SQL Managed Instance
Deploy SQL Server inside Azure VM. This involves a lot of work and maintenance.
Here's some docs that can help :
https://learn.microsoft.com/en-us/azure/azure-sql/database/serverless-tier-overview
https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/sql-managed-instance-paas-overview

Filtered one-way synchronization of Azure SQL database

We have a multi-tenant, single db application where some customers have expressed the desire to get direct access to their own data.
I have been suggested looking into Azure Data Sync to achieve a setup where each of the customers get their own Azure SQL instance to which we setup a one-way synchronization of their data from the master database.
I managed to find some documentation on this, but one I got around to try it out in a lab setup, it looks like the ability to filter rows in the sync job has been removed in a later iteration of the Azure Data Sync service.
Am I wrong or is that feature really gone? If so, what would be your suggestions to achieve something similar on Azure?
You cannot filter rows using Azure SQL Data Sync. However, you can build a custom solution based on Sync Framework as explained here.

DQS and Azure SQL

So I know that DQS isn't available in Azure, at least not yet. I was wondering though, is it possible to link an on-prem instance that holds the information to an Azure processing task and create a hybrid?
I just wondered if this has been tried/people knew if it could be before I tried anything myself.
Thanks

How to run a T-SQL query daily on an Azure database

I am trying to migrate a database from a sql server into Azure. This database have 2 rather simple TSQL script that inserts data. Since the SQL Agent does not exist on Azure, I am trying to find an alternative.
I see the Automation thing, but it seems really complex for something as simple as running SQL scripts. Is there any better or at least easier way to do this ?
I was under the impression that there was a scheduller for that for I can't find it.
Thanks
There are several ways to run a scheduled Task/job on the azure sql database for your use case -
If you are comfortable using the existing on-premise sql sever agent you can connect to your azure sql db(using linked servers) and execute jobs the same way we used to on on-premise sql server.
Use Automation Account/Runbooks to create sql jobs. If you see marketplace you can find several examples on azure sql db(backup,restore,indexing jobs..). I guess you already tried it and does not seem a feasible solution to you.
Another not very famous way could be to use the webjobs(under app service web app) to schedule tasks(can use powershell scripts here). The disadvantage of this is you cannot change anything once you create a webjob
As #jayendran suggested Azure functions is definitely an option to achieve this use case.
If some how out of these if you do not have options to work with the sql directly , there is also "Scheduler Job Collection" available in azure to schedule invocation of HTTP endpoints, and the sql operation could be abstracted/implemented in that endpoint. This would be only useful for less heavy sql operations else if the operation takes longer chances are it might time out.
You can use Azure Functions to Run the T-SQL Queries for Schedule use Timely Trigger.
You can use Microsoft Flow (https://flow.microsoft.com) in order to create a programmed flow with an SQL Server connector. Then in the connector you set the SQL Azure server, database name, username and password.
SQL Server connector
There are many options but the ones that you can use to run a T-SQL query daily are these:
SQL Connector options
Execute a SQL Query
Execute stored procedure
You can also edit your connection info in Data --> Connections menu.

Can I use SSIS to pull data directly from the Google Analytics API?

Not great at programming so not all that confident of being able to pull data from the Google API.
Basically what I'm trying to do is pull everything from Google Analytics, all data and dump it into a table on a SQL Server (2008 R2). What would be the best way of achieving this?
Would like to automate the process so that it could be scheduled say once a month.
Cheers
There an existing add-on specifically for accessing Google Analytics.
Haven't used it but from what I read seems like it will exactly what you are looking for
http://www.google.com/analytics/apps/about?app_id=1325007
There is a specific SSIS DataSource Component for that – https://analyticssource.codeplex.com
It is open source and free.