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 2005 Forums
 Transact-SQL (2005)
 Script

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2010-12-28 : 13:52:06
I got the below error..How should i correct it

Warning! The maximum key length is 900 bytes. The index 'IDX_table_columnname' has maximum length of 7000 bytes. For some combination of large values, the insert/update operation will fail.

Please suggest

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2010-12-28 : 13:57:36
I assume you're creating an index. Look at the INCLUDE statement

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-12-28 : 13:59:56
How about you post the index DDL as well as the queries you are targeting?

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 - 2010-12-28 : 14:00:07
Oh and we need the data types and sizes.

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

Subscribe to my blog
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2010-12-28 : 14:56:48
I am creating the non clustered index on the column of the table which has columname nvarchar(7000)...

Below is my query..

CREATE INDEX IDX_Tablename_Columnname ON Database.dbo.Tablename (Columnname)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-12-28 : 14:59:14
That is not a good index then. Any insert or update command that exceeds 900 bytes will fail because of your index.

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

Subscribe to my blog
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2010-12-28 : 15:43:18
Thanks for reply..

What is the alternative solution to avoid the insert or update command that exceeds 900 bytes fail..
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-12-28 : 15:50:43
Why do you need to index it? Have you considered Fulltext search instead?

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

Subscribe to my blog
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2010-12-28 : 23:53:14
Can you guide me about fulltext search..
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-12-29 : 11:01:48
No, please google it and check BOL. It's well documented and wouldn't make sense for me to regurgitate the documentation here.

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -