Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    Join Date
    Jun 2005
    Posts
    79

    Unanswered: Convert datetime columns to smalldatetime in whole database

    Hi,

    I need to convert all datetime columns to smalldatetime in the whole database. I really don't want to do it by hand and It would probably take me a whole day to figure out how to write such a procedure. If someone could help me out that would be great.
    My database is divided into schemas just like AdventureWorks.
    Also, no need to worry about date conversion, value could be set to current date.

    Thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    may i ask a stupid question?

    why?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2005
    Posts
    79
    That is a stupid question.

    Choose my answer:
    1. Why not?
    2. Because
    3. Cause I feel like it
    4. All of the above

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    1. because changing it is pointless
    2. ok
    3. good for you
    4. all of the above

    have fun stormin' the castle...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by PolarBear2k
    That is a stupid question.

    Choose my answer:
    1. Why not?
    2. Because
    3. Cause I feel like it
    4. All of the above
    Fill in the blank: Kiss my ____________.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by blindman
    Fill in the blank: Kiss my ____________.
    Asphalt .
    George
    Home | Blog

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by PolarBear2k
    That is a stupid question.

    Oh, foolesh young jedi
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  8. #8
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by PolarBear2k
    I really don't want to do it by hand

    Then you should look into better grooming and more social skills

    I'm sure you can find a date if you try hard enough

    Lobster and champange work pretty well if you can master the other stuff
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  9. #9
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Everyone seems really mean these days. Or am I just noticing it having come back?

  10. #10
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by pootle flump
    Everyone seems really mean these days. Or am I just noticing it having come back?

    That is a stupid question

    (So how does that feel?)
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  11. #11
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Brett Kaiser
    That is a stupid question

    (So how does that feel?)
    Waaaaaaaahhhhhhhhhhhhhhhh!!!!!!!!!

  12. #12
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by PolarBear2k
    That is a stupid question.

    Choose my answer:
    1. Why not?
    2. Because
    3. Cause I feel like it
    4. All of the above

    The list is not complete

    You left off ignorance
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  13. #13
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i am not mean

    i would like to go back and try to re-start this friendly dialogue

    dear polarbear2k, why do you want to do it?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  14. #14
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by r937
    i am not mean
    I didn't mean you. it was a perfectly valid question to ask - the parameters of the solution were included in the original post but not the parameters of the problem.

  15. #15
    Join Date
    Jun 2005
    Posts
    79
    If you must know its a legacy software issue. A program we have craps out when you pass it seconds. Formatting the output is an option but preventing the problem in the first place is a better solution.

    We really need the extra 4 bytes freed up.

    Everybody is so mean. lol

Posting Permissions

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