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 2000 Forums
 Transact-SQL (2000)
 Table Name

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-09-07 : 07:05:59
query writes "i have a tables name "CITY CODE","ABC-ABC" in query analyzer how do i write select query to retrieve data coz "select * from CITY CODE" is not working for both table"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-09-07 : 07:07:33
Put square brackets around the table name:

SELECT * FROM [CITY CODE]
SELECT * FROM [ABC-ABC]


SQL Server Books Online has more information on identifier names under the index heading "identifiers-SQL Server".
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-08 : 02:03:24
It is better to avoid space or hypen in the names. Use _ (underscore) instead

Madhivanan

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

- Advertisement -