Sql Server, Difference between

Posted by Raja_89 under Sql Server on 4/6/2013 | Points: 10 | Views : 777 | Status : [Member] | Replies : 3
Hai Techies

While creating a field in Server Explorer in V.S .2010 at some times it will display it will display the field name within square brackets like [eid]
Is there any meaning for this type
If yes what is the meaning




Responses

Posted by: Chandan88 on: 4/6/2013 [Member] Starter | Points: 25

Up
0
Down
Brackets are used just to avoid the confusion between table name and field name i.e the column name.


Chandan Singh

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 4/6/2013 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
@Chandan88 is right.

When SQL want to execute your Query it needs to know what is what. So the first thing it will want to know what is a Column and what is is a Keyword , imagine when you have a field called "User_ID", in SQL this is a sql reserved keyword that is why it turns pink. so for SQL not go and check what you are referring to , its good to put in in the bracket to save processing time.


Thank you for posting at Dotnetfunda
[Administrator]

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sandeepmhatre on: 4/22/2013 [Member] Starter | Points: 25

Up
0
Down
it also differentiate between sql reserved keyword and user defined table columns

Sandeep M,
Software Developer
Follow me on :
http://sandeepmhatre.blogspot.in

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response