Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Space in table name 1

Status
Not open for further replies.

junkjones

Programmer
Jul 14, 2000
52
GB
I need to query a table that has a space name in it. (I know I know - it wasn't me that named it).

I've tried these three versions:

select *
from [Price Index]

select *
from "Price Index"

select *
from 'Price Index'

And I always get the error: Invalid object name 'Price Index'.

What is the correct syntax?

TIA
 
The first one should work.

Check the owner of the table. It may be that you need to qualify the tablename:

Code:
SELECT * FROM [owner].[price index]

--James
 
BINGO! That's exactly what I was doing wrong - thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top