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 |
|
anik5
Starting Member
6 Posts |
Posted - 2006-06-20 : 11:48:27
|
| The following script is giving an error BUT NOT ALWAYS:Warning: The table '#tmp1' has been created but its maximum row size (9423) 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.There has never been error on #tmp2Both tables are EXACTLY the same.Any suggestions? Is this a problem with ALTER TABLE? The total row size is less than 5000 including the unicode nvarcharThanks for suggestions.drop table #tmp1drop table #tmp2create table #tmp1 (f5 uniqueidentifier,f1 nvarchar(50), f2 nvarchar(200), f10 int,f11 int)alter table #tmp1 add [f6] [uniqueidentifier] ,[f8] [uniqueidentifier] ,[f3] [nvarchar] (2000) ,[f4] [nvarchar] (200) ,[f9] [bit] create table #tmp2 (f5 uniqueidentifier,f1 nvarchar(50), f2 nvarchar(200), f10 int,f11 int,[f6] [uniqueidentifier] ,[f8] [uniqueidentifier] ,[f3] [nvarchar] (2000) ,[f4] [nvarchar] (200) ,[f9] [bit] ) |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-06-20 : 12:06:30
|
| seehttp://www.nigelrivett.net/SQLAdmin/AlterTableProblems.htmlIt explains why alter table can cause a lot of wasted space in a row and shows how to see where space is wasted.Note what you have isn't an error it's a warning saying that the table you created has the possibility of a too long row. You won't get an error unless the data inserted causes a too long row.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
anik5
Starting Member
6 Posts |
Posted - 2006-06-20 : 12:17:59
|
| Thanks for the excellent link. I understand the error is not really an error - just a warning. |
 |
|
|
|
|
|
|
|