How to run a script to update all 01/01/1900 to null in a date type column?

  • How to run a script to update all 01/01/1900 to null in a date type column?

  • adonetok (12/9/2011)


    How to run a script to update all 01/01/1900 to null in a date type column?

    Ummm. . .

    UPDATE myTable

    SET myDate = NULL

    WHERE myDate = '1900-01-01'


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • it's just a simple update...

    UPDATE MyTable

    Set MyDateColumn = NULL

    WHERE MyDateColumn ='1900-01-01'

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Second Place...again 😉

    WTG Cadavre.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (12/9/2011)


    Second Place...again 😉

    WTG Cadavre.

    ..::''''::..

    .:::. .;'' ``;.

    .... ::::: :: :: :: ::

    ,;' .;: () ..: `:::' :: :: :: ::

    ::. ..:,:;.,:;. . :: .::::. `:' :: .:' :: :: `:. ::

    '''::, :: :: :: `:: :: ;: .:: : :: : : ::

    ,:'; ::; :: :: :: :: :: ::,::''. . :: `:. .:' ::

    `:,,,,;;' ,;; ,;;, ;;, ,;;, ,;;, `:,,,,:' :;: `;..``::::''..;'

    ``::,,,,::''


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 5 posts - 1 through 4 (of 4 total)

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