Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server CE / September 2007

Tip: Looking for answers? Try searching our database.

Column Padding

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MikeB - 18 Sep 2007 13:45 GMT
Hello All,

I just converted my 2.0 db to 3.0 and am running into problems where sqlce
appears to be padding some of my columns which are varchars.  For example my
where clause "WHERE device_id = "1966" doesn't return anything while "WHERE
device_id LIKE '%1966" and WHERE RTRIM(device_id) = "1966" does.  I even
checked the len by calling select LEN(device_id) and it did return 4.

What am I doing wrong?  Can anyone help?
Ginny Caughey [MVP] - 18 Sep 2007 14:57 GMT
Mike,

Is the double quote a typo? What do you get with WHERE device_id = '1966' ?

Signature

Ginny Caughey
Device Application Development MVP

> Hello All,
>
[quoted text clipped - 5 lines]
>
> What am I doing wrong?  Can anyone help?
MikeB - 18 Sep 2007 17:17 GMT
Yes it was a typo and I get nothing with Where device_id = '1966'.

ALso, this appears to be isolated to sql server on the mobile.  When ran on
the mobile, I get nothing, then when I copy the sdf to my desk top and run
it from sql management studio it runs fine?

> Mike,
>
[quoted text clipped - 11 lines]
>>
>> What am I doing wrong?  Can anyone help?
Ginny Caughey [MVP] - 18 Sep 2007 19:26 GMT
Is this with SQLce 3.1?

Thanks,

Signature

Ginny Caughey
Device Application Development MVP

> Yes it was a typo and I get nothing with Where device_id = '1966'.
>
[quoted text clipped - 17 lines]
>>>
>>> What am I doing wrong?  Can anyone help?
Ginny Caughey [MVP] - 18 Sep 2007 19:33 GMT
One other question, is the data type varchar or nvarchar? Do you have a
small sample that reproduces it including the part that creates the sdf
file?

Signature

Ginny Caughey
Device Application Development MVP

> Is this with SQLce 3.1?
>
[quoted text clipped - 21 lines]
>>>>
>>>> What am I doing wrong?  Can anyone help?
Mike Bevins - 19 Sep 2007 11:25 GMT
I am using SQLCE 3.0

The data type is a nvarchar(10).

I am not 100% sure what you mean, basically to repoduce it, all I have to do
is a select * from table where device_id = '1966' using the Query Analyzer
3.0 on the handheld or even when it is called from code on the handheld.
Then if I copy the sdf to my desktop and then run the exact same query using
management studio, it works fine.

As for creating the DB,  I used the upgrade utility to convert it from 2 to
3.

> One other question, is the data type varchar or nvarchar? Do you have a
> small sample that reproduces it including the part that creates the sdf
[quoted text clipped - 25 lines]
>>>>>
>>>>> What am I doing wrong?  Can anyone help?
Ginny Caughey [MVP] - 19 Sep 2007 11:35 GMT
Ok thanks.

Signature

Ginny Caughey
Device Application Development MVP

>I am using SQLCE 3.0
>
[quoted text clipped - 38 lines]
>>>>>>
>>>>>> What am I doing wrong?  Can anyone help?
Mike Bevins - 19 Sep 2007 12:28 GMT
I think I am getting closer to the cause of it.  I upgraded the DB and then
ran the sql (select * from table where device_id = '1966' ).  I then
modified the table using management studio (I added a column ID as a primary
key with identity set to true and I begin having this problem.

> Ok thanks.
>
[quoted text clipped - 40 lines]
>>>>>>>
>>>>>>> What am I doing wrong?  Can anyone help?
Ginny Caughey [MVP] - 19 Sep 2007 13:05 GMT
Do you still have the problem if you do a Repair/Compact on the database? I
don't know why adding a column should cause your select statement to begin
failing unless the database has become corrupted. Do you get any error
message, or does it just not return any rows?

Signature

Ginny Caughey
Device Application Development MVP

>I think I am getting closer to the cause of it.  I upgraded the DB and then
>ran the sql (select * from table where device_id = '1966' ).  I then
[quoted text clipped - 45 lines]
>>>>>>>>
>>>>>>>> What am I doing wrong?  Can anyone help?
Mike Bevins - 19 Sep 2007 13:53 GMT
I will have to compacting / repairing it to see if that helps.  Also, no, I
do not get any errors, it just returns nothing.

> Do you still have the problem if you do a Repair/Compact on the database?
> I don't know why adding a column should cause your select statement to
[quoted text clipped - 50 lines]
>>>>>>>>>
>>>>>>>>> What am I doing wrong?  Can anyone help?
Mike Bevins - 19 Sep 2007 14:18 GMT
Okay, I just compacted / repaired the DB and that did not help.

> Do you still have the problem if you do a Repair/Compact on the database?
> I don't know why adding a column should cause your select statement to
[quoted text clipped - 50 lines]
>>>>>>>>>
>>>>>>>>> What am I doing wrong?  Can anyone help?
Ginny Caughey [MVP] - 19 Sep 2007 16:02 GMT
Ok, here's another question: can you reproduce the same behavior in a new
database?

Signature

Ginny Caughey
Device Application Development MVP

> Okay, I just compacted / repaired the DB and that did not help.
>
[quoted text clipped - 52 lines]
>>>>>>>>>>
>>>>>>>>>> What am I doing wrong?  Can anyone help?
Mike Bevins - 19 Sep 2007 17:14 GMT
No, it only appears to start happening after I modify it with the management
studio.

> Ok, here's another question: can you reproduce the same behavior in a new
> database?
[quoted text clipped - 55 lines]
>>>>>>>>>>>
>>>>>>>>>>> What am I doing wrong?  Can anyone help?
Ginny Caughey [MVP] - 19 Sep 2007 19:07 GMT
Ok, thanks, Mike.

Signature

Ginny Caughey
Device Application Development MVP

> No, it only appears to start happening after I modify it with the
> management studio.
[quoted text clipped - 62 lines]
>>>>>>>>>>>>
>>>>>>>>>>>> What am I doing wrong?  Can anyone help?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.