Link to home
Get AccessLog in
Avatar of TickTech
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??????????????
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Try this:

alter table  TestTable2Delet
  ALTER COLUMN  FirstName varchar(25) Not Null,   LastName  varchar(25) Not null
Avatar of TickTech
TickTech

ASKER

Hi Dan,

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ','.
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
SOLUTION
Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
thanks for the help.
You're welcome.
Glad I could help!