all groups > sql server new users > august 2005 >
You're in the

sql server new users

group:

Row size


Row size rocky20
8/26/2005 3:28:27 PM
sql server new users:
I know the max row size in SQL Server is 8060, but what happens if I go over
the max row size. Will some of the data be lost? Will I have problems with
backing up the database or importing or exporting data? Also, does the 8060
size apply to rows in Views also, or is it just for tables?

Thank You in advance.

Re: Row size Mike Epprecht (SQL MVP)
8/27/2005 12:12:48 AM
Hi

The Update or Insert that pushes the row over 8060 bytes fails with an
error.
If you need larger column storage, you need to look at the datatypes TEXT
and IMAGE.

With SQL Server 2005, the same limit exists, but new datatypes make it
easier to use.

Regards
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mike@epprecht.net

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

[quoted text, click to view]

Re: Row size Adam Machanic
8/28/2005 1:07:43 PM
[quoted text, click to view]

Although the limit technically exists in SQL Server 2005 for
fixed-length types, the row will automatically overflow for variable length
types, so in most cases it's not an issue any longer. Try the following
batch (in 2005):


CREATE TABLE #x
(
ColA VARCHAR(7000),
ColB VARCHAR(7000)
)

INSERT #x VALUES (REPLICATE('0', 7000), REPLICATE('0', 7000))

SELECT LEN(ColA) + LEN(ColB)
FROM #x

DROP TABLE #x


--
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--


AddThis Social Bookmark Button