Azure SQL Data warehouse ADO.Net Error Codes - sql

I just want to ask the following questions below:
Are SQL error codes in Azure SQL database will also apply in Azure SQL Data Warehouse?
Can anyone point me the URL where I can find list of error codes that's specific only from Azure SQL data warehouse?
Cheers,
Jhessie

Yes, they are the same. Reference: MSDN Forum
To view all the error messages, you can execute this query on master:
select * from sys.messages;

Related

How to copy one table data to another one between two Azure databases on the same server

I want to copy data from one database table into another database table on the same server in Azure SQL. I have done all of the Azure SQL Cross Database Query' steps that are written here https://www.mssqltips.com/sqlservertip/6445/azure-sql-cross-database-query/but still get the same error whenever I execute a query
'Reference to database and/or server name in 'db name' is not supported in this version of SQL Server.'
Can you pls help to figure out this?
Azure SQL database doesn't support across query directly.
We can not use USE statements and it not supported. That's why you get the error. We can not run statements like select * from [other_database].[schema].[table].
In Azure SQL database, only elastic query overview (preview) can achieve cross database query:
The elastic query feature (in preview) enables you to run a
Transact-SQL query that spans multiple databases in Azure SQL
Database. It allows you to perform cross-database queries to access
remote tables, and to connect Microsoft and third-party tools (Excel,
Power BI, Tableau, etc.) to query across data tiers with multiple
databases.
You could follow the tutorial and it may be more complex than on-premise SQL Server:
Get started with cross-database queries (vertical partitioning) (preview)

Microsoft Azure - no SQL Data Warehouse

Microsoft refers to creating an instance of a SQL Data Warehouse on Azure (NB NOT SQL Database), but there is no instance there that I can see. Please see attached screenshot of the Azure Portal Marketplace after typing in "SQL Data Warehouse".
This is part of their Data Science Associate Certification (Step 1 here: https://learn.microsoft.com/en-gb/learn/modules/understand-the-sql-dw-connector-with-azure-databricks/2-setup-the-environment) so would really appreciate if anyone can advise on how to get around / resolve this ??
NB if I try to create instead a SQL Database I come unstuck at step 4 in the above link as there is no option for "Select Performance level".
KR, Barry Walsh
SQL Data Warehouse is now renamed as "Azure Synapse Analytics."
This is now Dedicated SQL Pool(formerly SQL DW)
Please create Azure SQL Data Warehouse database using the following method.
Click Create a resource in the upper left-hand corner of the Azure portal.
Select Databases from the New page, and select SQL Data Warehouse under Featured on the New page.
Fill out the form.
Select an existing Server or click Create new to create and configure a new server for your new database.
When finished, make sure you create a firewall rule that adds your client IP so you can connect to your database.

How to capture truncate statement information in SQL Server 2012

I would like to capture the truncate statements information along with the user/Login information for all database in my production server.
Example:
Use mydb
go
truncate table deleteme_table
I would like to capture the information into the table like the below
Table Operation Database Login Time
deleteme_table Truncate mydb sandeep.pulikonda 17-12-2014 17:50:00
If the above scenario is not possible please suggest possible ways to capture it
I am using SQL Server 2012 Standard version. So granular level audit are not supported for that version.
you can use the SQL Server Audit functionality and add an audit for those queries.
this article explains in detail how to obtain this.
Another good way of profiling your SQL Server is using SQL Profiler. Here is a SO question similar to yours and an answer describing how to use SQL Profiler to achieve the results.
SQL Server Profiler - How to filter trace to only display TSQL containing a DELETE statement?

Using 2 differecnt DB's in same SP in SQL Azure

I am using an SP which will insert data in 2 tables in 2 different DB's. To mainitain the transaction, the SP has been designed like that. Its working fine in SQL Server environment.
Like Insert into AdminDB.EmpSiteConfig values(,,,)
Insert into MainDB.EmpDetails values(,,,)
where AdminDB and MainDB are the database names.
But when I migrate it to SQL Azure, I am getting an error as follows.
'Reference to database and/or server name in MainDB.dbo.EmpDetails' is not supported in this version of SQL Server.'
Can somebody tell me how to get rid of this error? Or is there any workaround for this?
Thanks in advance.
SQL Azure does not currently support linking to another server. As to workarounds, you could create a queue message requesting a specific action for data insertion. In your worker role, consume the queue message and call a separate stored procedure on each database.
although i think it is better to use David Makogon's solution you might want to take your changes with SQL Shard: http://enzosqlshard.codeplex.com/

Retrieving users for specific SQL Server databases

I have a few SQL Server databases (all in one server), containing their own set of users. Now I'm trying to design a small application that would query those users and then display them in a report (TBD). I've looked over online how to do this, however I didn't find any. Is it possible in SQL Server to retrieve all the users of a database? If so, how?
On SQL Server 2005 and up:
connect to that specific database you're interested in
USE Databasename
execute this query
SELECT * FROM sys.database_principals
That gives you a slew of information on all users defined in the database
See the MSDN documentation for a detailed explanation of all rows returned from that view.