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.
Author |
Topic |
jerill
Starting Member
7 Posts |
Posted - 2011-11-02 : 14:42:35
|
Hi,I have table called : table1 with 200 rows.I have Column1 as 1st column which is nvarchar and null. I want to change this column to NOT NULL and make that column1 as primary key. But its not allowing me to do that.I checked that all values are NOT NULL for Column1.Still,alter table table1alter column column1(nvarchar(50),not null ) is not working ?Any inputs ? |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-11-02 : 15:20:25
|
Define 'not working'--Gail ShawSQL Server MVP |
|
|
lpozdol
Starting Member
6 Posts |
Posted - 2011-11-08 : 17:32:08
|
do you get an error on alter? Or it runs, but the column still shoes as nullable? |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2011-11-08 : 17:47:40
|
your syntax was wrong. try this:alter table table1alter column column1 nvarchar(50) not nullBe One with the OptimizerTG |
|
|
|
|
|