SELECT FROM tablename containing space?

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
 
C

copyco

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

This holds true for field names as well.
 
S

srinivas moorthy

hi
Just do like this
select * From [order details]

hope this solves your problem
thanks
srinivas moorthy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top