T-SQL - Aliasing using "=" versus "as"

I wouldn't use it simply as it looks far too much like equality operation. 'AS' is clear inasmuch that it's not ambiguous to me.

Its the same as not using upper case in sql, I find it harder to read.


‘=’ isn't valid ANSI SQL, so you'll have difficulty should you wish to run your application on a different DBMS.

(It's when ANSI form is used but the optional ‘AS’ is omitted I find the results difficult to read, personally.)


To put in some counterweight, I prefer using =.

If I am the consumer of the query results in some way, I find it more convenient to see what columns I as a consumer can use.

I prefer this

SELECT
      [ElementObligationID] = @MaxElementObligationID + eo.ElementObligationID
      , [ElementID] = eo.ElementID
      , [IsotopeID] = eo.IsotopeID
      , [ObligationID] = eo.ObligationID
      , [ElementWeight] = eo.ElementWeight * -1
      , [FissileWeight] = eo.FissileWeight * -1
      , [Items] = eo.Items * -1
      , [Comment] = eo.Comment
      , [AdditionalComment] = eo.AdditionalComment
      , [Aanmaak_userid] = @UserID
      , [Aanmaak_tijdstip] = GetDate()
      , [Laatste_wijziging_userid] = @UserID
      , [Laatste_wijziging_tijdstip] = GetDate()
FROM  dbo.KTM_ElementObligation eo
      INNER JOIN dbo.KTM_ElementObligationArticle eoa ON 
          eoa.ElementObligationID = eo.ElementObligationID

over this

SELECT
      @MaxElementObligationID + eo.ElementObligationID AS [ElementObligationID]
      , eo.ElementID AS [ElementID]
      , eo.IsotopeID AS [IsotopeID]
      , eo.ObligationID AS [ObligationID]
      , eo.ElementWeight * -1 AS [ElementWeight]
      , eo.FissileWeight * -1 AS [FissileWeight]
      , eo.Items * -1 AS [Items]
      , eo.Comment AS [Comment]
      , eo.AdditionalComment AS [AdditionalComment]
      , @UserID AS [Aanmaak_userid]
      , GetDate() AS [Aanmaak_tijdstip]
      , @UserID AS [Laatste_wijziging_userid]
      , GetDate() AS [Laatste_wijziging_tijdstip]
FROM  dbo.KTM_ElementObligation eo
      INNER JOIN dbo.KTM_ElementObligationArticle eoa ON 
          eoa.ElementObligationID = eo.ElementObligationID

just my 2c.