How do I reference a column name with an embedded space?

I am trying to get just a few columns from a SQL Server table using:
SELECT col1, col2, col3 FROM tablename
However col3 is actually "Badge #"  (don't blame me - I didn't do the DDL!)

How do I specify the column name to transact SQL when it has an em bedded space?

Thanks!
Ken
kenfhendersonAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
BrandonGalderisiConnect With a Mentor Commented:
wrap it in brackets.

select col1, col2, [badge #]
from [dbo].[Your Table can have spaces too]
0
 
kenfhendersonAuthor Commented:
Thanks super much for the quick answer!
0
All Courses

From novice to tech pro — start learning today.