I was following this article to setup cross database query in Azure SQL Database. The only difference is that, My origin DB and master DB is same, i.e., I want to setup cross query from master database.
Now according to step 5, we need to create database scoped credential in master DB. But when I run this query in SSMS, I get Database credentials are not supported in master database., How to resolve this?
Related
I am using Logic Apps Designer on Azure to move source data to a storage file and I need to connect to a database on my SQL Server. To do this, I am using an on-premise connection througha gateway. I was able to successfully connect to my SQL Server database, however, when I am using Logic Apps action, not all tables are available on Logic Apps. Is there a security/permissions/connections issue that is preventing all tables from the SQL Server database not to return to Logic Apps?
enter image description here
enter image description here
I tried refreshing/restarting Azure and also tried connecting through with other authentications hoping more tables would return, but no luck.
I would suggest you to create a new api connection to sql and try to access tables again. There might be issue with connecting to db.
One of the alternative approaches to get row from sql db is using execute query action in logic app.
As shown in above picture, Execute a SQL query (V2) action is used to query table and retrieve records based on condition.
Reference link
I am trying to scale Azure SQLDW by following this document => azure link but help guide says, to run query under master DB.
I am logging in using system admin credential,
what am i missing.
Azure SQL DW master DB is the same with Azure SQL Server.
Please run the query in Database--System Database--master.
Login your Azure SQL DW with admin account, set the connect to database.
Step 1
Step 2
Step3
Hope this helps.
Given the first screen shot, it appears that you've connected to the user database and not the server with the default database. When connecting to your server in SSMS, click on the Connection Properties tab and make sure the Connect to database: value is set to <default>.
Connection Properties
Currently, we are mirroring our local SQL server Database with Azure SQL Server Database. For this, we are using Azure Data Management gateway but the problem is we are not able to handle the update or delete scenario. Update and Delete are not reflecting in Azure SQL Server database(Mirror).
Thanks.
What type of activity are you using in your pipeline? I'm assuming a simple copy activity?
My suggestion would be to have a copy activity that lands a clone of the on premises data in the Azure SQL DB first, maybe in a staging schema set of table or something. Then have a second downstream activity that performs a stored procedure execution activity. You can code a MERGE statement or whatever in the procedure to output the data into a separate table.
It sounds like you almost want a secondary node for your SQL Server in Azure. Maybe just use an availability group?! SQL 2014 or higher required on prem though.
You can also take a look at Transactional Replication to Azure SQL database, with transactional replication, Azure SQL database acts as a subscriber, update/delete changes you made in on-premises SQL Server database will be reflected in Azure SQL database.
(This is for an Azure SQL Database)
Just about every article says at the start to "connect to the master database" before creating a new DB.
I have connected to my Azure SQL Database server with SSMS 2014 with no problems. I see the master DB under System Databases. I right-click on Databases (this is above System Databases) in the tree on the LHS and click New Database...
The template query comments area says among other things "...connect to master..." which implies to me that I am not connected to the master.
I am obviously missing something very fundamental and obvious regarding basics.
Can someone please put me out of my misery :)
PS When I click "New Database..." when connected to my non-Azure SQL Server 2012 I get a GUI and I am able to create a DB no problem.
You do not need to explicitly connect to master to create a database in Azure SQL DB. Please follow the steps here to create a database in Azure SQL DB.
https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/
Also, can you please give me links to the articles that mention "Connect to master" so I can take a look and correct them if needed? Thanks.
I believe you are referring to the below template. You are actually connected to the master database and this is just a template instructions. If you are in doubt query select db_name() This should return 'master' for the master database.
If your connection string either specified database name as master / nothing it will be connected to master database.
-- ==========================================================================================================
-- Create database template for Azure SQL Database
-- This script will only run in the context of the master database. To manage this database in
-- SQL Server Management Studio, either connect to the created database, or connect to master.
I have a SQL Azure Database Server and I need to query between the Databases but can't figure out how to accomplish this.
Here is the structure of my databases:
Server.X
Database.A
Database.B
Database.C
In Database.A I have a Stored Procedure that needs to retrieve data from Database.B. Normally, I would reference the database like SELECT * FROM [Database.B].[dbo].[MyTable] but this does not appear to be allowed in SQL Azure.
Msg 40515, Level 15, State 1, Line 16
Reference to database and/or server name in 'Database.B.dbo.MyTable' is not supported in this version of SQL Server.
Is there a way to do this on the database end?
In the final version Databases A & C will both need data from Database B.
Update:
As per Illuminati's comment and answer, the situation has changed since this answer was originally accepted and there is now support for cross database queries as per https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/
Original Answer (2013):
Cross database queries aren't supported in SQL Azure. Which means you need to either combine the databases to prevent the need in the first place, or query both databases independently and basically join the data in your application.
Cross database queries are now supported in SQL Azure
https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/
Azure SQL DB is previewing Elastic Database Query feature at this point in time that will help you query among Azure SQL DBs with some limitations. You can get detailed information about the feature here.