Hi All,

What is the recommendation for having column like nvarchar(max) ? what should I put in the Length value in the designer when creating Entities nvarchar(max) ? 2147483647 maybe ?

Best Regards, Yordan

asked 24.08.2016 at 16:31

Stelt0's gravatar image

Stelt0
186283238
accept rate: 20%


Hi Stelt0

If you put in the Length with value 2147483646, it does give you the column varchar(max). If you really need to make it nvarchar(max), you may want to create a Java class (instead of a Data Class) and then you can flexibly configure your @Entity.

@Entity
public class BlogPost extends CompositeObject {

    @Column(columnDefinition="nvarchar(max)")
    public String content;

}
link

answered 30.08.2016 at 01:48

Genzer%20Hawker's gravatar image

Genzer Hawker
441202434
accept rate: 66%

nvachar(42) :-)

link

answered 29.08.2016 at 11:08

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
7.4k11347
accept rate: 70%

you are joking, right ?

(29.08.2016 at 11:49) Stelt0 Stelt0's gravatar image
1

yes: https://de.wikipedia.org/wiki/42_(Antwort)

but to really answer the question: you have to estimate the maximum length that will ever be used for that field. But that depends on your domain and can not be answered without knowledge about it. Choosing the maximum possible length will worsen your db performance.

(29.08.2016 at 12:19) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×29
×6
×2

Asked: 24.08.2016 at 16:31

Seen: 1,086 times

Last updated: 30.08.2016 at 01:48