dbTalk Databases Forums  

using modify table command

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss using modify table command in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
andy@excommerce.net
 
Posts: n/a

Default using modify table command - 11-22-2007 , 05:45 AM






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 ?

Reply With Quote
  #2  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: using modify table command - 11-22-2007 , 06:02 AM






On Nov 22, 11:45 am, a... (AT) excommerce (DOT) net wrote:
Quote:
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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.