Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cimonp
Starting Member
1 Post |
Posted - 2009-04-07 : 18:07:24
|
| helloWhat is the goal behind writing some things in the select query in square brackets?I came across such a querySelect user_name , [user_file], legendFrom user_file)infowhy some things are in square brackets?What will happen if we do not put square brackets? |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-04-07 : 18:10:30
|
| nada, niente, wala hanti, rien , nothing :) sometimes they can be useful for when you do selects from legacy application and field name has space in between [ci monp] or You want to use a system varible such as Date then you would have to use [date] etc. I hate them brackets though.Just my thought<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2009-04-07 : 18:11:20
|
| [] define object names when those name have weird or illegal chars in them.___________________________________________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.5 out! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-08 : 04:05:30
|
quote: Originally posted by spirit1 [] define object names when those name have weird or illegal chars in them.___________________________________________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.5 out!
in addition to keywords like GROUP, ORDER, etc MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|