Monday, January 14, 2013 6:52 AM
"as" is optional ,so please tel me should i use it or not (keepting future in mind)
becasue i have to use it throught the database.
some body pointed out that one can save client side number of bytes .
some body said it is good practice.
Monday, January 14, 2013 7:00 AM
From my point of view you should use because it will clearly point out that paritcular is an alias.. Also on client side byte issue ....
How many byte "as" will consume in a current technology era..??
Monday, January 14, 2013 7:12 AM
"AS' is the ISO standard for aliasing columns. I don't think you can save much bytes by excluding the use of "AS"
However a number of other ways for column aliasing exists in T-SQL and these are much of personal choice. Aaron Bertrand has an interesting article on this (the link is below):
Monday, January 14, 2013 8:47 AM
And how I lament that AS is optional!
I once spent a Friday afternoon looking at an INSERT statement that went:
INSERT (col1, col2, col3, ..... col48)
SELECT col1, col2 col3, .... col48
And all SQL Server cared to tell me that there was a mismatch with the number of columns between the INSERT and the SELECT list.. Had AS been optional it would have told me "Incorrect syntax near 'col3'" and pointed me straight to the error.
Erland Sommarskog, SQL Server MVP, email@example.com