MyronCope Posted May 30, 2006 Share Posted May 30, 2006 (edited) I am trying to write a script to insert more than one column but the script I am making only inserts the column in the second line and I dont know why. In my code below, columnB is added to the table, but not columnA. I am stumpedMy sql is: Alter table [dbName].[dbo].[tableName] Add columnA bit Default 0 Not NullAlter table [dbName].[dbo].[tableName] Add columnB bit Default 0 Not Null thanks for your help. Edited May 30, 2006 by aspnetguy Link to comment Share on other sites More sharing options...
dooberry Posted June 13, 2006 Share Posted June 13, 2006 You don't need to write the ALTER table statement twice, you can separate the fields with commas: ALTER TABLE dbname.dbo.tablenameADD columnA bit Default 0 Not Null, columnB bit Default 0 Not Null Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now