azure-sql-database

ADF copy data activity - check for duplicate records before inserting into SQL db

风流意气都作罢 提交于 2020-04-18 03:49:34
问题 I have a very simple ADF pipeline to copy data from local mongoDB (self-hosted integration environment) to Azure SQL database. My pipleline is able to copy the data from mongoDB and insert into SQL db. Currently if I run the pipeline it inserts duplicate data if run multiple times. I have made _id column as unique in SQL database and now running pipeline throws and error because of SQL constraint wont letting it insert the record. How do I check for duplicate _id before inserting into SQL db?

Create user in Azure SQL database using Azure functions?

隐身守侯 提交于 2020-04-18 03:40:32
问题 I want to create users in Azure SQL database. I am running this PowerShell through Azure Functions. I have set up my own name as server admin. Also I have configured the firewall. But I am not able to connect to SQL database. It gives me error : Cannot open server "domain.com" requested by the login. The login failed. This is my script: $serverName = "servername.database.windows.net" $databaseName = "databasename" $adminLogin = 'user@domain.com' $PWord = "password" $query = "CREATE USER

Query with a UNION sub-query takes a very long time

落花浮王杯 提交于 2020-04-13 07:04:11
问题 I've been having an odd problem with some queries that depend on a sub query. They run lightning fast, until I use a UNION statement in the sub query. Then they run endlessly, I've given after 10 minutes. The scenario I'm describing now isn't the original one I started with, but I think it cuts out a lot of possible problems yet yields the same problem. So even though it's a pointless query, bear with me! I have a table: tblUser - 100,000 rows tblFavourites - 200,000 rows If I execute: SELECT

Unable to reach SQL database through SSH tunnel using sqlcmd

帅比萌擦擦* 提交于 2020-04-10 14:09:47
问题 I need to connect to a an Azure SQL DB from my local machine through a jump box (Azure VM). I set up the port forwarding using the command: ssh -fN -L 41433:my-db.database.windows.net:1433 me@jump-box I can confirm the tunnel is set up because in verbose mode i see the message Local connections to LOCALHOST:41433 forwarded to remote address my-db.database.windows.net:1433 Now, when I run sqlcmd -S 127.0.0.1,41433 -U username -P password -d db I get the following error message Sqlcmd: Error:

SSDT dropping and recreating permissions when deploying to Azure as database user

╄→尐↘猪︶ㄣ 提交于 2020-03-23 02:05:23
问题 We have an SSDT project which includes users, roles and permissions. It was working very nicely, but a recent move to Azure has caused, or possibly highlighted, a problem with deployment. Before Azure, certain project members had a user on the master db with sufficient permissions to publish databases. In Azure SQL Db, there is only one admin user, and those credentials shouldn't be shared around. So instead we thought we'd use sufficiently permissioned contained database users to publish.

Deploy database to Azure SQL fails, sp_MSforeachtable not found

社会主义新天地 提交于 2020-03-21 16:28:11
问题 I am trying to publish a SQL Server database using a .dacpac and publish profile to an Azure SQL database. We have been using on premises SQL Server with no problems for quite some time, and now we are evaluating Azure and AWS to see which is best suited for our needs. We have a SQL Server database project and want to deploy it to Azure SQL database, however it fails to execute the script generated by SSDT. This is because the generated script contains a call to the stored procedure sp

Error in Azure SQL Server Database connection using Azure Function for python with ActiveDirectoryMSI Authentication

一个人想着一个人 提交于 2020-02-24 12:50:22
问题 I am trying to connect the Azure SQL Database from Azure functions for python using ActiveDirectoryMSI Authentication. Please check the below code:- import logging from . import hy_param import sys import pyodbc import azure.functions as func def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') try: connection = pyodbc.connect('driver={%s};server=%s;database=%s;Authentication=ActiveDirectoryMSI' % (hy_param.sql_driver, hy

Error in Azure SQL Server Database connection using Azure Function for python with ActiveDirectoryMSI Authentication

强颜欢笑 提交于 2020-02-24 12:50:10
问题 I am trying to connect the Azure SQL Database from Azure functions for python using ActiveDirectoryMSI Authentication. Please check the below code:- import logging from . import hy_param import sys import pyodbc import azure.functions as func def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') try: connection = pyodbc.connect('driver={%s};server=%s;database=%s;Authentication=ActiveDirectoryMSI' % (hy_param.sql_driver, hy

Error in Azure SQL Server Database connection using Azure Function for python with ActiveDirectoryMSI Authentication

被刻印的时光 ゝ 提交于 2020-02-24 12:50:08
问题 I am trying to connect the Azure SQL Database from Azure functions for python using ActiveDirectoryMSI Authentication. Please check the below code:- import logging from . import hy_param import sys import pyodbc import azure.functions as func def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') try: connection = pyodbc.connect('driver={%s};server=%s;database=%s;Authentication=ActiveDirectoryMSI' % (hy_param.sql_driver, hy

SQL Server Management Studio 2014: Unable to view stored procedures on Azure SQL Database V12

梦想的初衷 提交于 2020-02-03 09:43:13
问题 I have updated SQL Server Management Studio to the latest version at time of writing - 12.0.4432.0 - this is SP1 with CU3 and additional bug fixes. My Azur SQL Database version is 12.0.2000.8 I can not view any stored procedures through the GUI, when I try I get this error (all other functionality appears to be working normally): TITLE: Microsoft SQL Server Management Studio Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) For help, click: http://go.microsoft