Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify Column

Status
Not open for further replies.

charbrad

Technical User
Nov 7, 2002
132
0
0
US
I am trying to modify a column of datatype char(31) to varchar(3)

Code:
ALTER TABLE dbo.zyx_abcdef_hdr
MODIFY vc_xxx_zzz varchar(3)

I am getting error message:
Code:
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near vc_xxx_zzz'

Any suggestions?
 
Ummmmm - I think you need to use ALTER COLUMN, not MODIFY.

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
thank you. To change from null to not null my syntax would be:
Code:
ALTER TABLE dbo.zyx_abcdef_hdr
ALTER COLUMN vc_xxx_zzz varchar(3) NOT NULL;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top