Re: Column Padding

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Okay, I just compacted / repaired the DB and that did not help.

"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message news:02C8E41F-2868-47BB-A3EC-9EC03E2B3A61@xxxxxxxxxxxxxxxx
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?

--
Ginny Caughey
Device Application Development MVP


"Mike Bevins" <MBevins@xxxxxxxxxxxxxxxxxxxxx> wrote in message news:47511ECE-8E30-4FBB-9BDB-484DE24B1691@xxxxxxxxxxxxxxxx
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.


"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message news:605D2E1C-359F-4D8A-8CF6-6CA2DB2D9EC6@xxxxxxxxxxxxxxxx
Ok thanks.

--
Ginny Caughey
Device Application Development MVP


"Mike Bevins" <MBevins@xxxxxxxxxxxxxxxxxxxxx> wrote in message news:0118A437-C0F6-45B7-BBC8-8540275A2E2D@xxxxxxxxxxxxxxxx
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.


"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message news:B3474816-ACB1-43E7-92C1-4741583BB717@xxxxxxxxxxxxxxxx
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?

--
Ginny Caughey
Device Application Development MVP


"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message news:748BD97E-2AA6-488B-AA6B-D88F7183C8FC@xxxxxxxxxxxxxxxx
Is this with SQLce 3.1?

Thanks,

--
Ginny Caughey
Device Application Development MVP


"MikeB" <mdb@xxxxxxxxxxx> wrote in message news:eBIvz%23g%23HHA.3900@xxxxxxxxxxxxxxxxxxxxxxx
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?


"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in message news:C0485AFC-8E32-4FCA-855B-08BD6C71D69F@xxxxxxxxxxxxxxxx
Mike,

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

--
Ginny Caughey
Device Application Development MVP


"MikeB" <mdb@xxxxxxxxxxx> wrote in message news:u1V2DIf%23HHA.1204@xxxxxxxxxxxxxxxxxxxxxxx
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?











.



Relevant Pages

  • Re: MS Sync Framework
    ... Ginny Caughey ... Device Application Development MVP ... Since SQL Compact supports multiple simultaneous connections to the database from the same machine, you should be able to update the sdf file from a separate thread or process if you use perhaps Web Services and read/write the data yourself rather than using RDA. ... Need a solution where the user just uses the app and the data sync is completely transparent. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: MS Sync Framework
    ... Ginny Caughey ... Device Application Development MVP ... Could you not "lock the app" in some way and simply make the IO copy of the one SDF over the other SDF on the device. ... The only way I can see to update the database already in use would be to write code that determines when a row needed updating, similar to what the Sync Framework does under the covers using a TimeStamp or LastEditDate column. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: MS Sync Framework
    ... Ginny Caughey ... Device Application Development MVP ... the one SDF over the other SDF on the device. ... the Sync Framework does under the covers using a TimeStamp or ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Column Padding
    ... it only appears to start happening after I modify it with the management studio. ... Ginny Caughey ... Device Application Development MVP ...
    (microsoft.public.sqlserver.ce)
  • Re: Column Padding
    ... Ginny Caughey ... Device Application Development MVP ... 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. ...
    (microsoft.public.sqlserver.ce)