TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft SQL Server

SQL 2005, changing VARCHAR column size

Microsoft SQL Server

 
 
Thread Tools Display Modes
Unread 25-10-2007, 03:28 PM   #1
Marius Horak
Guest
 
Posts: n/a
SQL 2005, changing VARCHAR column size

Management Studio allows to change the column size easy way.
It's instant so I think there is no ADD, DROP, UPDATE etc commands in
the background.

Is there a single SQL command that can resize (increase) VARCHAR column?

Thanks,

MH
 
Unread 25-10-2007, 03:32 PM   #2
Tibor Karaszi
Guest
 
Posts: n/a
Re: SQL 2005, changing VARCHAR column size

ALTER TABLE ... ATLER COLUMN...

Above is an instance operation for some type of modifications (like increasing size of varchar).

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Marius Horak" <nobody@eu.con> wrote in message news:%233rMbW$DIHA.5228@TK2MSFTNGP05.phx.gbl...
> Management Studio allows to change the column size easy way.
> It's instant so I think there is no ADD, DROP, UPDATE etc commands in
> the background.
>
> Is there a single SQL command that can resize (increase) VARCHAR column?
>
> Thanks,
>
> MH

 
Unread 25-10-2007, 03:39 PM   #3
Marius Horak
Guest
 
Posts: n/a
Re: SQL 2005, changing VARCHAR column size

Tibor Karaszi wrote:

> ALTER TABLE ... ATLER COLUMN...
>
> Above is an instance operation for some type of modifications (like
> increasing size of varchar).


Thank you. It works.
But why BOL does not show such option?
One pays M$ zillions of dollars and gets old help info.

ALTER TABLE table_name
{ [ ALTER COLUMN column_name
{DROP DEFAULT
| SET DEFAULT constant_expression
| IDENTITY [ ( seed , increment ) ]
}

MH

 
Unread 25-10-2007, 03:41 PM   #4
Tibor Karaszi
Guest
 
Posts: n/a
Re: SQL 2005, changing VARCHAR column size

> But why BOL does not show such option?

Perhaps you wre looking in the "SQL Server Mobile" section? Here's what my Books Online say (ALTER
TABLE):

ALTER TABLE [ database_name . [ schema_name ] . | schema_name . ] table_name
{
ALTER COLUMN column_name
{
[ type_schema_name. ] type_name [ ( { precision [ , scale ]
| max | xml_schema_collection } ) ]
[ COLLATE collation_name ]
[ NULL | NOT NULL ]


--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Marius Horak" <nobody@eu.con> wrote in message news:uEEEYIJEIHA.536@TK2MSFTNGP06.phx.gbl...
> Tibor Karaszi wrote:
>
>> ALTER TABLE ... ATLER COLUMN...
>>
>> Above is an instance operation for some type of modifications (like
>> increasing size of varchar).

>
> Thank you. It works.
> But why BOL does not show such option?
> One pays M$ zillions of dollars and gets old help info.
>
> ALTER TABLE table_name
> { [ ALTER COLUMN column_name
> {DROP DEFAULT
> | SET DEFAULT constant_expression
> | IDENTITY [ ( seed , increment ) ]
> }
>
> MH
>



 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 11:29 PM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional