search in database sql Compact RRS feed

  • Question

  • i have 2 table first tabel name item
    have colom -  Barcode primary key , Item_code 
    the table 2 name Pack  the colom  pack_id, Item_code  ,price  primary key ( Item_code  , pack_id)

    i am using program in the windows Ce  when search the tebel Barcode
    SELECT  * FROM barcode  where barcode  ='00166171'
    the results show Very fast
    but when search the price by pack_id and Item_code 
    the results show Very slow
    SELECT  * FROM Pack    where item_code ='0200003088' and pack_id='CTN'

     My friend told me   Using uniqueidentifier 
       I did not know Use  uniqueidentifier 

    vb dev
    Wednesday, March 9, 2011 1:35 PM

All replies

  • you might want to post your question to either the SQL Server forum or the SQL Compact forums as this is the Synchronization Framework forum.

    to answer your question very briefly, uniqueidentifier is a data type and am not sure how its going to help speed up your query in your scenario.

    how many rows do you have on your Pack table compared to your barcode table?

    Wednesday, March 9, 2011 1:43 PM
  • thank JuneT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals

    table barcode  254670 records

    tabel pack 312879 records


    for Example

    this barcode  '00166171' retern 3 rwos ( PCS CTN BOX) price ( PCS=7.00$ CTN=42.00$ BOX=14.00$)
    I well   chose the type that I want


    vb dev
    Wednesday, March 9, 2011 3:56 PM