Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mb
Starting Member
16 Posts |
Posted - 2002-06-19 : 07:22:55
|
| Does any know the systax for modifying a column precision say from 30 to 100.On oracle I would useAlter table tablename modify ( columnName varchar(100))but this doesnt seem to work on sql server. |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2002-06-19 : 07:35:06
|
| From SQL Books On-Line:ALTER TABLE table { [ ALTER COLUMN column_name { new_data_type [ ( precision [ , scale ] ) ] [ COLLATE < collation_name > ] [ NULL | NOT NULL ] | {ADD | DROP } ROWGUIDCOL } ] .....Edited by - YellowBug on 06/19/2002 07:35:36 |
 |
|
|
mb
Starting Member
16 Posts |
Posted - 2002-06-19 : 07:38:47
|
| That seems to insinuate that this should work:alter table zzcompanycontact alter UserName varchar(100) nullHowever it throws back this errorServer: Msg 170, Level 15, State 1, Line 1Line 1: Incorrect syntax near 'UserName'. |
 |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2002-06-19 : 07:43:18
|
| That should read:alter table zzcompanycontact alter COLUMN UserName varchar(100) null You are missing the keyword COLUMN |
 |
|
|
mb
Starting Member
16 Posts |
Posted - 2002-06-19 : 07:48:51
|
| Doh! Cheers yellow bug |
 |
|
|
|
|
|