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 |
|
drewsalem
Constraint Violating Yak Guru
304 Posts |
Posted - 2005-12-05 : 07:12:58
|
| Hi,How do you query on a table that has spaces in its name?Example:Select Top 100 * From dbo.Sales DetailCheers,Drew |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2005-12-05 : 07:29:09
|
| use.. enter the table name in the box brackets.. []Select Top 100 * From [dbo.Sales Detail]Sucess Comes to those who Believe in Beauty of their Dream.. |
 |
|
|
drewsalem
Constraint Violating Yak Guru
304 Posts |
Posted - 2005-12-05 : 07:37:24
|
| I tried that and gotMsg 208, Level 16, State 1, Line 1Invalid object name 'dbo.Sales Detail'.The table is there in the right database. Queries are returned if the table has no space in its name. |
 |
|
|
svicky9
Posting Yak Master
232 Posts |
Posted - 2005-12-05 : 07:44:11
|
| try this select * from dbo.[sales detail]cheersVicVicky |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-12-05 : 07:45:24
|
| Select Top 100 * From dbo.[Sales Detail]You should avoid using spaces when naming the objects. Instead use underscore(_) like Sales_Detail to avoid unnecessary problemsMadhivananFailing to plan is Planning to fail |
 |
|
|
drewsalem
Constraint Violating Yak Guru
304 Posts |
Posted - 2005-12-05 : 07:53:36
|
Thanks Vicky Thank you all. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-12-05 : 07:57:52
|
Hereafter, Better follow what I suggested  quote: You should avoid using spaces when naming the objects. Instead use underscore(_) like Sales_Detail to avoid unnecessary problems
MadhivananFailing to plan is Planning to fail |
 |
|
|
swatib
Posting Yak Master
173 Posts |
Posted - 2005-12-08 : 06:38:08
|
I fully agreed with Madhivanan!! The naming conventions has to be followed to avoid future conflicts.....Njoy Life |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|