SELECT FROM tablename containing space?

  • Thread starter Thread starter Michael Lang
  • Start date Start date
M

Michael Lang

I've written a generic code generator that generates classes with properties
based on table names and fields. I'm just now testing it with the Northwind
database. One of the tables is named "Order Details". I have to remove the
space or replace it with an underscore for the class names. How do I
qualify the table name in my SELECT statement? Single quote?

Select * FROM 'Order Details' ??

I couldn't find this in the help files.

Mike
 
You can enclose the table name in brackets...
"select * from [order details]"

This holds true for field names as well.
 
hi
Just do like this
select * From [order details]

hope this solves your problem
thanks
srinivas moorthy
 
Back
Top