TickTech
asked on
10 second "ALTER TABLE ALTER COLUMN" question
New to SQL2012, need help on simple sql question
////////////////////////// ////////// ////////// ////////// ////////// ////////// ////////// /////
--The following code runs and no error
alter table TestTable2Delet
ALTER COLUMN FirstName varchar(25) Not Null
////////////////////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////
--The following code don't run, ?????WHY????? Does it mean I have to have a "alter table" sentence for each alter column line??????????????
alter table TestTable2Delet
ALTER COLUMN FirstName varchar(25) Not Null,
ALTER COLUMN LastName varchar(25) Not null
---?????WHY????? Does it mean I have to have a "alter table" sentence for each alter column line??????????????
//////////////////////////
--The following code runs and no error
alter table TestTable2Delet
ALTER COLUMN FirstName varchar(25) Not Null
//////////////////////////
--The following code don't run, ?????WHY????? Does it mean I have to have a "alter table" sentence for each alter column line??????????????
alter table TestTable2Delet
ALTER COLUMN FirstName varchar(25) Not Null,
ALTER COLUMN LastName varchar(25) Not null
---?????WHY????? Does it mean I have to have a "alter table" sentence for each alter column line??????????????
ASKER
Hi Dan,
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ','.
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ','.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the help.
You're welcome.
Glad I could help!
Glad I could help!
alter table TestTable2Delet
ALTER COLUMN FirstName varchar(25) Not Null, LastName varchar(25) Not null