Re: Column Padding

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



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: 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)
  • Re: Column Padding
    ... Ginny Caughey ... Device Application Development MVP ... Then if I copy the sdf to my desktop and then run the exact same query using management studio, ...
    (microsoft.public.sqlserver.ce)
  • Re: Column Padding
    ... Ginny Caughey ... Device Application Development MVP ... Then if I copy the sdf to my desktop and then run the exact same query using management studio, ...
    (microsoft.public.sqlserver.ce)
  • Re: Database for a Pocket PC - Desktop syncing application
    ... Maybe your team will upgrade before long. ... Ginny Caughey ... Device Application Development MVP ... I cannot use SQL Compact 3.5 as all my development systems are still using VS 2005. ...
    (microsoft.public.pocketpc.developer)