using modify table command

Hi All

Am new to sql server to sobear with me, have checked around but cant
find an answer to this.

I want to change fieldname from nvarchar(50) to nvarchar(255) as part
of a script

Am running this command :
ALTER TABLE MYTABLE MODIFY fieldname nvarchar(255) null

i test this out in the sql window but cant get it to run error is:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'MODIFY'.

Can anyone help ?
Andy [ Do, 22 November 2007 12:45 ] [ ID #1876586 ]

Re: using modify table command

On Nov 22, 11:45 am, a... [at] excommerce.net wrote:
> Hi All
>
> Am new to sql server to sobear with me, have checked around but cant
> find an answer to this.
>
> I want to change fieldname from nvarchar(50) to nvarchar(255) as part
> of a script
>
> Am running this command :
> ALTER TABLE MYTABLE MODIFY fieldname nvarchar(255) null
>
> i test this out in the sql window but cant get it to run error is:
> Msg 102, Level 15, State 1, Line 1
> Incorrect syntax near 'MODIFY'.
>
> Can anyone help ?

ALTER TABLE myTable ALTER COLUMN fieldname nvarchar(255)

Good luck!
J
jhofmeyr [ Do, 22 November 2007 13:02 ] [ ID #1876588 ]
Datenbanken » comp.databases.ms-sqlserver » using modify table command

Vorheriges Thema: need urgent help
Nächstes Thema: how to copy files using xp_cmdshell