Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 alter table

Author  Topic 

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2005-08-19 : 10:43:17
Hi,
There is a table which has one of the columns set not to accept null.
What is the script to make it accept null.
Thanks

Kristen
Test

22859 Posts

Posted - 2005-08-19 : 11:04:09
Easiest way, I think, is to make the change in Enterprise Manager Table Designer, and then press the "Script the changes" button (which gives you a script you can cut&paste) and then abandon making the changes in E.M.

This will give you a script which takes care of foreign keys, data conversion, and all sorts of other thorny issues!

Kristen
Go to Top of Page

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2005-08-19 : 11:18:03
Hi,
where do i find the script changes button as you suggested pls?
Thanks
Go to Top of Page

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2005-08-19 : 11:23:02
Worked it out .
Thanks

alter table UM_TB_Person
alter column lastname nvarchar(50) null
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-08-19 : 13:04:32
"where do i find the script changes button as you suggested pls?"

Third icon from the left, tooltip = "Save change script" - looks like an old fashion scroll & a floppy disk.

Kristen
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-08-19 : 13:29:48
alter table UM_TB_Person
alter column lastname nvarchar(50) null

I belive that approach has consequences for leaving some "crud" in the table, which can lead to inefficiencies, but if its a small table I don't suppose it will make any odds!

Kristen
Go to Top of Page
   

- Advertisement -