Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    7

    Unanswered: UPDATE or not UPDATE, thatīs the question

    Iīve got a little "problem"...

    This is the thing...

    I have a LARGE table, in it, Iīve got some EQUAL records

    I want to UPDATE the first one...

    I tried this:

    UPDATE Table SET value=1000 WHERE value IN (SELECT TOP 1 value FROM Table WHERE value=1 and comb=4000)

    I tried that, and then this, (just for making things work)..

    SELECT TOP 1 value INTO temp FROM table WHERE value=1 and comb=4000

    and...

    UPDATE temp SET value=1000

    and...

    DROP TABLE temp...

    In the query... fails... I DONT KNOW WHY...

    Im running this query into an ADOCE object ( i dont think that the problem is here ) against a MS-SQL 2000 Server...

    Some ideas? I search the net and donīt find answers... maybe here...

    THANKS "friends"...

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    It is not clear what do you want to do. What do you mean EQUAL records? Is there a primary key or unique index?

  3. #3
    Join Date
    Sep 2003
    Posts
    7
    the records are exactly... no diference... but I already found de problem...

    SQL Server CE doesnīt support TOP into SELECT statement...

    So Im looking for a solution...

  4. #4
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Originally posted by Oaky
    the records are exactly... no diference... but I already found de problem...

    SQL Server CE doesnīt support TOP into SELECT statement...

    So Im looking for a solution...
    I guess you need to do this once for cleaning you table. If so, add fake primary key (identity) and do what you need.

  5. #5
    Join Date
    Sep 2003
    Posts
    7
    thx ppl...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •