Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Data size error in SSAS 2012 Tabular Table Import Wizard for n/varchar(max) Expand / Collapse
Posted Wednesday, March 20, 2013 6:06 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 9, 2013 10:50 AM
Points: 4, Visits: 18
Does anyone know the actual maximum string length values for columns of type varchar(max) or nvarchar(max) when using the Table Import Wizard in a tabular project?

I'm working my way through the Wrox book Professional SQL Server 2012 Analysis Services with MDX and DAX and trying my hand at tabular projects for the first time. A couple of the tables provided in the AdventureWorksDW relational database have nvarchar(max) fields. When attempting to add these tables via the Table Import Wizard, I receive an error. No error number or code is provided, just this:
The size of a data value in table '<table name plus long identifier string>' column '<column name>' was too large to fit in that column. The current operation was cancelled because another operation in the transaction failed.

If I filter out the column from the import, the rest of the tables import fine, but the text didn't mention needing to exclude the columns.

I checked out the Data Types Supported in BOL, and it contains the useful tidbit
You cannot import from a varchar(max) column that contains a string length of more than 131,072 characters.
"OK," I thought, "These fields are nvarchar(max), so that would probably max out at 65,536 characters since each character requires twice the bytes. There must be strings longer than that in my data."

However, when I ran both MAX(LEN(<field>)) and MAX(DATALENGTH(<field>)), one of the tables having the issue returned a maximum length for the field in question of only 34,568 characters and 69,136 bytes, well under the limit in BOL. Thinking it may be an issue with nvarchar(max) as opposed to varchar(max), I copied the data to a new table, moving the nvarchar(max) data to a varchar(max) field. Attempting to import from the varchar(max) field (now only 34,658 bytes) still generated the same error.

I haven't been able to locate any other information online about the error or about actual maximums enforced or whether or not it may be impacted by available memory (since it all has to be stored in-memory for the VertiPaq engine). I'd much appreciate any insight anyone has to offer.
Post #1433555
Posted Monday, February 8, 2016 12:25 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, May 13, 2016 3:48 PM
Points: 218, Visits: 150
It is working up to 30,000 character length in Tabular model.
Post #1759412
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse