Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)

  • RE: Basic SQL Query, going wrong somewhere......

    Dave Ballantyne (1/17/2011)


    I think this page will help you ....

    http://www.karaszi.com/SQLServer/info_datetime.asp

    Thanks for all the replys on the subject, I'd covered the above & got there in the end so many thanks...

  • RE: Basic Script Help!

    Chris Morris-439714 (7/7/2010)


    Ok...let's get started then. When scripting an UPDATE, always start with a SELECT. Something like this:

    SELECT TOP 100 [disabled], [date created]

    FROM MyTable

    WHERE [date created] < '2005-06-01 00:00:00.000'

    Thanks...

  • RE: Basic Script Help!

    Chris Morris-439714 (7/7/2010)

    No it won't, not without modification.

    Have you got backups of your data?

    How important to you / your company is your data?

    If you don't mind losing it forever...

  • RE: Basic Script Help!

    Chris Morris-439714 (7/7/2010)

    UPDATE MyTable SET [disabled] = MyNewValue

    WHERE [date created] < 'June 2005'

    Edit: This is a basic UPDATE statement, it doesn't get any easier - except you will have...

  • RE: Basic Script Help!

    Chris Morris-439714 (6/21/2010)


    Looks like an UPDATE to me.

    UPDATE docsadm.shellorganisation

    SET [disabled] = 'y'

    WHERE docsadm.shellorganisation.org_name LIKE 'do not use%'

    Sorry to drag an old thread back up to the top, however I...

  • RE: Basic Script Help!

    That worked a treat! Thanks Chris & everyone else for there input 🙂

    Cheers

    OMD

  • RE: Basic Script Help!

    That looks & appears to make more sense Chris 🙂

    I'll give it a whirl.

    Thanks

    OMD

  • RE: Basic Script Help!

    Chris Morris-439714 (6/21/2010)


    What are you trying to do here? Insert new rows into shellorganisation, or update existing rows?

    Hi,

    I'm trying to add a value (that value being Y) to the same...

  • RE: Basic Script Help!

    blue_inelush (6/21/2010)


    Hello,

    You need to change your script from:

    INSERT INTO docsadm.shellorganisation (disabled) VALUES ('y');

    WHERE (((docsadm.shellorganisation.org_name) like 'do not use%'));

    to something like this:

    Insert into docsadm.shellorganisation (disabled)

    select 'y' -- what columns do...

Viewing 9 posts - 1 through 9 (of 9 total)