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.
| Author |
Topic |
|
brendalisalowe
Constraint Violating Yak Guru
269 Posts |
Posted - 2005-04-11 : 14:38:58
|
| I am trying to do this:ALTER TABLE tblFeePaidALTER COLUMN NotesText varchar(8000) NULLAnd it gives me this error:Cannot alter column 'NotesText' because it is 'text'.Warning: The table 'tblFeePaid' has been created but its maximum row size (14148) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.Is there anyway I am going to be able to change the data type? I don't care if I lose some data. Thanks!BrendaIf it weren't for you guys, where would I be? |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-04-11 : 14:53:59
|
| here are 2 options:1) drop and re-add column2) re-name table and create new table with original name.1)Select pkVals, substring(notesText, 1, 8000) [NotesText INTO NewTable from origTablealter table origTable Drop Column NotesTextGOAlter table origTable Add NotesText varchar(8000)GOupdate a set NotesText = b.NotesText from origTable a JOIN newTable b ON a.pkVals = b.pkVals2)sp_rename 'origTable', 'origTableBAK'GOSelect <colList>, substring(NotesText,1,8000) as NotesText INTO origTableBe One with the OptimizerTG |
 |
|
|
jhermiz
3564 Posts |
Posted - 2005-04-11 : 15:14:32
|
What about reducing the size from 8000 to something like 5000 ? Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]Imperfection living for perfection -- [url]http://jhermiz.blogspot.com/[/url] |
 |
|
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2005-04-11 : 15:34:59
|
| Could you UPDATE the text column to be of size 8000 or less before executing the ALTER TABLE?HTH=================================================================In order to improve the mind, we ought less to learn than to contemplate.-Rene Descartes, philosopher and mathematician (1596-1650) |
 |
|
|
brendalisalowe
Constraint Violating Yak Guru
269 Posts |
Posted - 2005-04-11 : 15:43:37
|
| I just did 7000 instead of 8000 and it worked. Thanks for the help!BrendaIf it weren't for you guys, where would I be? |
 |
|
|
|
|
|