This is a migrated thread and some comments may be shown as answers.

How do I expand the auto generated column size? String or binary data would be truncated

2 Answers 57 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 2
Chris asked on 24 Nov 2013, 11:13 PM
I am auto-generating the DB from code and am getting the following error:

String or binary data would be truncated

... which is due to the string being a bit too long for the underlying SQL.  I would like the column that's created to be nvarchar(max), however that setting seems to only be in the code-first configuration.

Here is the link I found regarding fluent configuration.

http://documentation.telerik.com/openaccess-orm/documentation/developers-guide/code-only-mapping/mapping-clr-types-properties-and-associations/advanced-mapping/backend-independent-mapping/fluent-mapping-mapping-clr-advanced-backend-independent-string-properties

2 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 2
answered on 25 Nov 2013, 03:42 AM
I found that if I right click on the table, I have the ability to edit the properties of the columns.  I was expecting this to be in properties of the column name itself.
0
Kristian Nikolov
Telerik team
answered on 25 Nov 2013, 04:46 PM
Hi Chris,

I am glad you have resolved the situation.

As you found out, one of the ways to change the SQL type of the column to nvarchar(max), or any other type, is to use the Table Editor.

Note that the SQL type can also be set using the SqlType property located in the properties window of the column. Using this approach however, you will have to type the name of the property manually instead of selecting it from a drop-down list.

Additionally, in case you need to change the SQL type of multiple columns, you can do so by using Model Operations:
  1. Open the Model Operations dialog.
  2. Select Members as the Display Mode. You can filter the displayed columns by their SQL type.
  3. Choose the columns which which type you wish to change.
  4. From the Operation drop-down list, select the Change SQL Type operation.
  5. Click the Execute button.

I hope this helps. In case you have additional questions, feel free to contact us via our ticketing system or post in our forums again.

Regards,
Kristian Nikolov
Telerik
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Tags
Getting Started
Asked by
Chris
Top achievements
Rank 2
Answers by
Chris
Top achievements
Rank 2
Kristian Nikolov
Telerik team
Share this question
or