Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 22nd, 2004, 10:56 AM
Jay Kolomeysky Jay Kolomeysky is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Jay Kolomeysky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Maximum row size

I am writing a utility that takes an Access database, creates the same database in SQL Server (using OSQL) and then copies the data from one to the other. When I create a table called itemdata I get the following warning:

Warning: The table 'itemdata' has been created but its maximum row
size (11665) 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.


However, when I add up the sizes of all the columns in that table they come to just 5,803. Does SQL Server add some kind of meta data to the columns which makes the records larger or is something else to blame? Thanks in advance.

Reply With Quote
  #2  
Old June 22nd, 2004, 11:00 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
SQL Server does seem to store a lot of extra info for its databases, but I wouldn't have thought it'd be that much more. How does your itemdata table differ from other tables that are created successfully? Is it a lot larger? Does it have an abundance of one data type not found in other tables? I'm not familiar enough with SQL Server's setup to offer much help, but maybe considering some questions like these will help you figure out what other questions to google for.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old June 22nd, 2004, 11:29 AM
Jay Kolomeysky Jay Kolomeysky is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Jay Kolomeysky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
itemdata is the largest of all my tables and it's made up of nothing but varchars which is the same for my other tables. The thing is that one of the fields in Access was a memo field which means it has virtualy no limit on how big it can be. But in SQL Server I don't have that option so I'm trying to make it a reasonable size without truncating any of the records I'm copying over from Access and at the same time leaving enough room for future records we may want to add.

Reply With Quote
  #4  
Old June 22nd, 2004, 11:33 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Hmmm, tricky. What field type have you made the memo field? Maybe having a huge varchar screws the limit and changing that field to a text or comparable field (I don't remember the data type in SQL Server, but I think it's text, as it is in mysql) would solve your problem.

Reply With Quote
  #5  
Old June 22nd, 2004, 11:35 AM
Jay Kolomeysky Jay Kolomeysky is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Jay Kolomeysky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I made all the fields nvarchar. What's the difference between that, varchar, and text?

Actualy looking back at the Access database all the fields are text. When I exported the table to SQL Server the export made all the fields nvarchar and the memo field ntext of size 16. So I changed the memo field to a size of 4000 and type nvarchar. I then used the utility in SQL Server which allows you to generate the commands for creating the current tables. That's how I got them all to be nvarchars. If I change the type of the field to text it won't let me change the size of it to anything other than 16.

Edit: In case anyone is interested here is why the nvarchar fields are so large
http://www.ispirer.com/doc/sqlways37/Output/SQLWays-1-069.html

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > Maximum row size


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT