update

  • How can I update a bit filed when I use a select statement, like

    SELECT Acct FROM Emp WHERE Inactive = 0 AND

    code = 5032 AND fileSent = 0

    when i select the above statement I want to update filesent field to 1

  • You need to use an update statement in order to update

    For the above result,

    UPDATE emp

    SET    fileSent = 1

    WHERE  Inactive = 0

    AND    code = 5032

    AND    fileSent = 0

    .. should do it.

    /Kenneth

     

  • No,

    whatI mean is when I select a record in my application, I want to make it as true in my bit filed. pls help.

  • Eh..?

    You mean like 'how do I turn a tick in my box in the windowsform' type thing..?

    Sorry, but I'm lost to what your problem is.

    You need to explain more what you mean by 'application' and what 'bit field' is in this case.

    /Kenneth 

  • you would need to do it in 2 steps. You cant SELECT and UPDATE at the same time.

    ******************
    Dinakar Nethi
    Life is short. Enjoy it.
    ******************

  • Probably the best way would be to create a stored procedure that SELECTs the data you want and then UPDATEs the bit. Then have your application run the stored procedure.

    -SQLBill

  • I think we need a more generic explanation in simple words to what the real problem is - that is, what is the purpose - instead of the specifics of 'how to do x on y'..?

    /Kenneth

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply