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)
 How to add not null column

Author  Topic 

venkath
Posting Yak Master

202 Posts

Posted - 2006-07-04 : 13:57:09
Hi all

i have a table lkp_Static_data ...
How to add a column to the table with not null specification


Thanks



RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2006-07-04 : 14:21:15
alter table lkp_Static_data add col varchar(10) not null default ''


Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

venkath
Posting Yak Master

202 Posts

Posted - 2006-07-04 : 14:47:52
Thanks..But my scenarie is...
ALTER TABLE LKP_STATIC_DATA_DETAIL ADD LIST_NAME NVARCHAR(50);
ALTER TABLE LKP_STATIC_DATA_DETAIL ADD CODE NVARCHAR(80);
ADD PRIMARY KEY LKP_STATIC_DATA_DETAIL_PK4 LKP_STATIC_DATA_DETAIL(LIST_NAME, CODE, CONTEXT_CODE, LANGUAGE_CODE);

How can i do the above task...
Help on this is greatly appreciated...

Thanks


Go to Top of Page

yogeshsr11
Starting Member

2 Posts

Posted - 2006-07-04 : 19:15:36
Just use the ALTER in the same script and GO after each DDL. If you want to add the newly created column in PK then do so at end

Yogesh Ranade
Go to Top of Page
   

- Advertisement -