By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,419 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,419 IT Pros & Developers. It's quick & easy.

insert new columes

P: 26
dear all

if I have table has three columes already and each have some values inside already

and I want to add 6 columes extra for that table and put values 0 inside each of the new columes..

I used the sql query



ALTER TABLE mytable ADD columename int NULL

but these create columes with null values but I want to create with 0 values and I tried to replace Null by 0 but I had an error



any ideas
Feb 12 '09 #1
Share this Question
Share on Google+
5 Replies


P: 6
ALTER TABLE mytable ADD columename int NOT NULL
Feb 12 '09 #2

P: 26
this solution doesn't work..in adition I want to insert zero value
Feb 12 '09 #3

ck9663
Expert 2.5K+
P: 2,878
set the default constraint...

-- CK
Feb 13 '09 #4

P: 26
what sql command for that??
Feb 14 '09 #5

ck9663
Expert 2.5K+
P: 2,878
Here, read this

-- CK
Feb 14 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.