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.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Editing maximum length in database design

Author  Topic 

RGallo
Starting Member

1 Post

Posted - 2011-08-31 : 13:38:02
Whenever I change the field lenth and then try to save I get this error:

error 1: maximum length- maximum length - property can not be changed

Does anyone know how to fix this?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-31 : 13:52:11
where are you trying to change this value?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2011-08-31 : 14:07:49
use T-SQL in a query window to perform DDL operations. ie:

use tempdb
create table #tg (i int primary key, vc varchar(10))
go
select CHARACTER_MAXIMUM_LENGTH
from information_schema.columns
where table_name like '#tg%'
and column_name = 'vc'

print 'alter table #tg alter column vc varchar(15)'
alter table #tg alter column vc varchar(15)


go
select CHARACTER_MAXIMUM_LENGTH
from information_schema.columns
where table_name like '#tg%'
and column_name = 'vc'

go
drop table #tg

OUTPUT:
CHARACTER_MAXIMUM_LENGTH
------------------------
10

alter table #tg alter column vc varchar(15)

CHARACTER_MAXIMUM_LENGTH
------------------------
15


Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -