Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Posts
    25

    Unanswered: change column to nullable

    hello,

    could someone help me out with some code to change a column from not nullable to nullable in a sproc? i need to do this temporarily and then change it back.

    thanks!

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Refer to Books online for ALTER TABLE... ALTER COLUMN topics.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    May 2003
    Posts
    25
    i have checked BOL... i was just a little confused.

    is this the correct way for an already existing column?

    ALTER TABLE MyTable ALTER COLUMN myColumn int NULL

    then to change it back...

    ALTER TABLE MyTable ALTER COLUMN myColumn int NOT NULL

Posting Permissions

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