Cross Database Query in Azure SQL Database

Azure
You can't query across databases in Azure SQL Database... or can you? Let's check. I've created two new databases on an existing server: I've created two tables on each respective database: CREATE TABLE dbo.DB1Table ( ID INT IDENTITY(1, 1) NOT NULL PRIMARY KEY, Val VARCHAR(50) ); CREATE TABLE dbo.DB2Table ( ID INT IDENTITY(1, 1) NOT NULL PRIMARY KEY, Val VARCHAR(50) ); Now, let's query the DB2 table from the DB1 database: SELECT * FROM DB2.dbo.DB2Table AS dt; And here's the lovely error message: Msg 40515, Level 15, State 1, Line 35 Reference to database and/or server name in 'DB2.dbo.DB2Table' is not supported in this version of SQL Server. So, like I said, you can't do three part name cross-database queries in Azure SQL Database... oh wait, that's not quite what I said…
Read More

Loading Data into Azure SQL Data Warehouse

Azure, Data Science
Ouch. Let's start with the level set. I'm not an ETL expert. In fact, I haven't done any professional ETL work for several years. My skills are, at best, rusty. With this in mind, I knew I'd have a hard time extracting data from a local database in order to move it up to Azure SQL Data Warehouse. I expected to be fumbling and slow and to constantly feel more than a little stupid as I made one mistake after another. All of this came to pass. Yet... OMG! THAT WAS DIFFICULT! Here's how I started. I defined a bcp command for the tables I was interested in. I ensured it was working correctly, then wrote a little PowerShell script so I could supply a list of tables and get…
Read More