Never!
You were expecting a longer post about this? Well alright then, never ever!
Whenever I see tons of SQL Transforms around a Data Services job, it is normally a sign of a lazy developer. Some-one who had written out the queries in SQL, and instead of building proper data flows using the Query transform and other built in Data Services functionality, just copied and pasted the sql into the SQL transform.
But what's wrong with that? Well plenty!
DS is NOT a glorified schedulerFor starters, you just bought a not-inexpensive ETL tool that you are now just using as a query scheduler. If all you want to do is automate your queries then write them into a stored procedure and schedule it on the database. Don't waste your money on a world class ETL tool.
You've just broken Impact and Lineage analysisOne of the biggest selling points of using a tool like DS, is you can visually see where a field is used in your ETL and where its data ultimately ends up. Likewise, you can see where a particular piece of data came from by tracing it all the way back to the source system.
This is a fantastic governance tool for managing your warehouse. You can see if, and where, making a change to a source system will affect your data warehouse.
The second you put a SQL transform in the way, you've just broken your impact and lineage analysis. DS treats it as a black box, so whether you are using the lineage in the management console, Data Services Designer
View Where Used function, or in Information Steward, you have just rendered it useless.
In the Datastore below it appears is if none of the tables are being used in any jobs.
But then after a little searching I find an SQL transform.
I look inside it and what do I find?
And this query is hardly complex. It wouldn't have taken very long to develop as a proper data flow with the Query transform, and now some future developer could make changes to the job thinking that they have everything covered, but not realize that 3 extra tables were hidden inside an SQL transform.
I can't tell you how many times I've needed to make a change, right clicked on the table in the data store and chosen V
iew Were Used, made all my changes, only to later discover I've missed one that a developer hid in a SQL transform.
Squinting at code
One of the great things about using a GUI based ETL tool is that you can open a data flow and immediately get an idea of what it is doing. You can see the tables on the screen, see which transforms they flow through and understand what is happening to the data and where it is going. With a SQL transform you have to open it up, squint at the code to try and figure out what it is up to.
For simple SQL that's not a big deal, but a complicated query with plenty of tables and joins.... well now you're wasting my time, and my client's money too!
Should you really never use the SQL transform?
I worked in a company where they had a ban on using the SQL transform. Turn in your code with one in it, and it got returned to you to have it rewritten without the SQL transform. No exceptions.
I will admit, there are times when you will just have to use the SQL transform, but these should be rare exceptions. Sometimes you need to do something very complex, that's maybe only available on the database, so you have to use the SQL transform to take advantage of it.
Before you do it though, think really hard about whether you couldn't achieve the same thing using Data Services built in transforms. Even if you have to split it out over multiple data flows, it will still be better than using the SQL transform.
azure online courses
ReplyDeletejava online courses
salesforce online courses
hadoop online courses
Data Science online courses
linux online courses
etl testing online courses
web methods online courses
nice post.sql azure training
ReplyDeletesql azure online training
sql azure online course