Udostępnij za pośrednictwem


Developers MERGE thyselves?

I was reading this CIO.com article a while back and wondering if “database developers” and “regular developers” agree.

As Microsoft sees it, the roles of the database-centric developer and "regular" developer are less distinct than they once were, so the company is merging its VSTS database and development products. As of October 1, those who belong to the Microsoft Developer Network (MSDN) and currently own Visual Studio Team System 2008 Development Edition or Visual Studio Team System 2008 Database Edition will receive for free the Visual Studio Team System 2008 Development Edition, Visual Studio Team System 2008 Database Edition, Visual Studio 2005 Team System for Software Developers and Visual Studio 2005 Team System for Database Professionals. (CIO.com)

Is it really that simple? Or will it be in the future? Are all (or most) “regular” developers also database developers? And vice versa? Hmmm.

The whole imaginary syntax probably looks something like this:

MERGE Developers.All_Developers AS target
USING
(
SELECT
COALESCE(dbds.DeveloperId, rds.DeveloperId) AS DeveloperId
,COALESCE(dbds.FullName, rds.FullName) AS FullName
,COALESCE(dbds.IsActive, rds.IsActive) AS IsActive
FROM Developers.Database_Developers AS dbds
FULL OUTER JOIN Developers.Regular_Developers AS rds
ON dbds.DeveloperID = rds.DeveloperID
GROUP BY COALESCE(dbds.DeveloperId, rds.DeveloperId)
) AS source (DeveloperId, FullName, IsActive)
ON (target.DeveloperId = source.DeveloperId)
WHEN MATCHED
THEN UPDATE SET
target.IsActive = source.IsActive
,target.FullName = target.FullName
WHEN NOT MATCHED
THEN INSERT (DeveloperId,FullName,IsActive) VALUES
        (source.DeveloperId,source.FullName,source.IsActive)
;

Seems complicated to me… for imaginary syntax of imaginary data constructs. Feel free to nitpick imaginary flaws in it.

Of course, YMMV.

Comments