Re: Column Padding

Tech-Archive recommends: Speed Up your PC by fixing your registry



Ok, here's another question: can you reproduce the same behavior in a new database?

--
Ginny Caughey
Device Application Development MVP


"Mike Bevins" <MBevins@xxxxxxxxxxxxxxxxxxxxx> wrote in message news:E959CE9B-6682-483F-8CB0-C9C343ADF72F@xxxxxxxxxxxxxxxx
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: Creating 3.5 databases ?
    ... Ginny Caughey ... Device Application Development MVP ... You can create the database using the Server ... TableAdapter and I can reference it in code. ...
    (microsoft.public.sqlserver.ce)
  • Re: Creating 3.5 databases ?
    ... Ginny Caughey ... Device Application Development MVP ... Can you open a database with tables created using the VS designer in SSMS for example and vice versa? ... "Mike Barrett" wrote in ...
    (microsoft.public.sqlserver.ce)
  • Re: Accessing SQL CE 2.0 file located in the desktop PC
    ... A TabletPC *is* a desktop. ... Device Application Development MVP ... Ginny Caughey wrote: ... I have a SQL CE 2.0 database file in my desktop. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Column Padding
    ... I don't know why adding a column should cause your select statement to begin failing unless the database has become corrupted. ... 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: Accessing SQL CE 2.0 file located in the desktop PC
    ... Ginny Caughey wrote: ... Device Application Development MVP ... How do I connect my device (a tablet PC) to my desktop? ... I have a SQL CE 2.0 database file in my desktop. ...
    (microsoft.public.dotnet.framework.compactframework)