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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 sql server 2008 r2 index size

Author  Topic 

jassie
Constraint Violating Yak Guru

332 Posts

Posted - 2012-08-03 : 16:11:59
I want to change the size of a notes field from varchar(500) to varchar(900). I am getting the error message, "changing the data type of column 'field2' on table 'test1' from 'varchar(500)' to 'varchar(900)' causes the following indexes to exceed the maximum index size of 900 bytes: index2.

I am trying to determine what my options are to fix this problem. I saw online that if I use a nonclustered index on a nonkey field, the 900 byte limit does not apply. However the table I am referring to is a clustered index and I do not want to change the index for this reason.

Note there are several foreign keys in the table I am referring to, however the primary key to this table is an 'int'.

The only option I can see is to increase the size of the field to varchar(886) instead of varchar(900). Are there any other options I would have?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-08-03 : 16:12:54
Does the notes column need to be included in the indexes?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-08-03 : 16:13:22
quote:
Originally posted by jassie

However the table I am referring to is a clustered index and I do not want to change the index for this reason.



This sentence doesn't make sense. Could you explain?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2012-08-03 : 17:08:37
Is there a NC index that has notes as part of the key (There must be). Seems like an odd choice for an index key BTW

-Chad
Go to Top of Page
   

- Advertisement -