Results 1 to 3 of 3

Thread: Check Column Data Type

Threaded View

  1. #1

    Thread Starter
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843

    Check Column Data Type

    We have a table that has a data type that needs to be changed.

    We have a .sql script that checks if the table has been created, if not, creates it. If the table has been created, we use an ALTER TABLE .. ALTER COLUMN call to fix it. That's working.

    The problem is that this script will be run on the client every day or so.
    I don't know the implications of constantly running an "ALTER COLUMN" command needlessly
    on a column that is already the correct data type.
    So I'd like to not run the command if the column type is already fixed.
    Unless someone can verify that the DB checks first, and really doesn't run anything if you ALTER COLUMN to the same type.

    EDIT: SQL SERVER 2005
    Last edited by JPicasso; Aug 9th, 2007 at 12:43 PM.
    Merry Christmas

Posting Permissions

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



Click Here to Expand Forum to Full Width