October 17, 2012 at 10:09 am
How do I Select a Field in SQL whose name has spaces?
Field: STR89 Type
Table (FROM): TRUS
Thanks
Regards
October 17, 2012 at 10:11 am
SELECT [column name with spaces in it] AS SensibleAlias FROM table
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 17, 2012 at 10:14 am
Thanks Qui-Gon Jinn!
October 17, 2012 at 10:51 am
Square brackets, as Gail told you, are always a safe way to refer to fields, even if you don't have spaces. Some languages also have accent marks, which can raise similar havoc - brackets help there as well. I deal with the issue occasionally in the Czech Republic, working on other people's databases. Best advice is to avoid both if at all possible, and stick to the standard Latin 26, or 36, if you like including numerals.
October 17, 2012 at 10:55 am
Thanks!
I deal with the issue occasionally in the Czech Republic
I deal with it to here in Portugal.
Regards
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply