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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 get data from column with space

Author  Topic 

EetieD
Starting Member

5 Posts

Posted - 2008-08-04 : 04:13:36
Hello all,

I was wondering how to get the data from a column when the column has a space. The column name is 'currency -'. Unfortunately I cannot get the data of this column. I already used single and double spaces, but that is also not the solution. Maybe somebody can help? Thanks.

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-08-04 : 04:17:42
not sure what you mean exactly but if the problem is a space in the column name then use square brackets...

select [any column name]
from YourTable

Em
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-04 : 05:09:25
Also, it is more readable and error free if you use underscore(_) in place of space for object names

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -