sqlce Select

M

mikeb

I'm trying to do a select on my sqlce database -

Select * from myTestTable Where (factory = 'ASDF') and (trackno = 'XC')

I can see records with these values in the factory and trackno columns, but
my query is coming back with 0 records.

I notice that when retrieving data from the tables, the column values come
back with spaces right filled onto the data - could this be why?

If I retrieve 'factory' from the table, I'll get 'ASDF ' --- If
this is really the cause of this, is there any way around having to append
all those spaces to each Where value??

Thanks!

Mike
 
A

Alex Feinman [MVP]

---
Visit http://www.opennetcf.org
mikeb said:
I'm trying to do a select on my sqlce database -

Select * from myTestTable Where (factory = 'ASDF') and (trackno = 'XC')

I can see records with these values in the factory and trackno columns,
but my query is coming back with 0 records.

I notice that when retrieving data from the tables, the column values come
back with spaces right filled onto the data - could this be why?

If I retrieve 'factory' from the table, I'll get 'ASDF ' --- If
this is really the cause of this, is there any way around having to append
all those spaces to each Where value??


Fields are space-padded because you defined them as having fixed width. If
you use NVARCHAR instead of NCHAR, they would not be padded. Of course the
performance is better with fixed width fields. At least that's how it is on
the big database. Not sure it holds true on the devices
 

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