Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. What is an alias?

What is an alias?

Scheduled Pinned Locked Moved Database
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shraddha_Patel
    wrote on last edited by
    #1

    What is an alias?

    L realJSOPR 2 Replies Last reply
    0
    • S Shraddha_Patel

      What is an alias?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      An alternative name.

      1 Reply Last reply
      0
      • S Shraddha_Patel

        What is an alias?

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #3

        It lets you replace [MyDB].[dbo].[MyTable] with a shorter name, such as a:

        SELECT a.*
        FROM [MyDB].[dbo].[MyTable] AS a

        You can also use the aliasiing feature on column names, like so:

        SELECT [MyReallyLongColumnName] AS ShorterName
        FROM [MyDB].[dbo].[MyTable]

        A simple google search will give you all the nuances regarding the use of aliasing in SQL Server (for columns, sometimes you should, sometimes you must, and sometimes you don't have to use aliasing. BTW, you generally alias table names when using join or merge.

        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
        -----
        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
        -----
        When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups