question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v8: Add varchar(max) support

See original GitHub issue

We need to be able to support NvarcharMax for SQL server in Umbraco. Currently there isn’t any support for this in the code, only NText which is deprecated.

We need to somehow support NvarcharMax but also keeping in mind that however this works would need to fallback to NText for SqlCe.

The migration syntax would need to support NvarcharMax along with DTO attributes.

Original post:

In v8 there is an ability to create DB tables using a builder interface. As part of this you can do things like define columns and their types. These then get built into a SQL statement to run on the various database types.

There is currently an ability to define columns as strings and provide an int size, such as

Create.Table("myTable").WithColumn("myColumn").AsString(255)

This will then get converted into a SQL statement that creates a column of type nvarchar(255).

Ones thing missing though is an ability to create a string column of type nvarchar(max) as max is clearly not an int value which the .AsString method requires.

We could really do with an additional means of defining a string value with it’s size set to max

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Shazwazzacommented, Apr 9, 2019

So keep in mind if you are using nvarchar max - you will need to support ntext as well if you are doing this from a package perspective else it won’t work with sqlce

0reactions
nul800sebastiaancommented, Aug 31, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

What size do you use for varchar(MAX) in your parameter ...
Varchar (max) is treated identically to varchar(8000) for values less than 8000 bytes. For larger values the field is treated as a "text"...
Read more >
node-mssql | Microsoft SQL Server client for Node.js
To setup MAX length for VarChar , NVarChar and VarBinary use sql.MAX length. Types sql.XML and sql.Variant are not supported as input parameters....
Read more >
Comparing VARCHAR(max) vs VARCHAR(n) data types in ...
This article gives an overview of varchar(max) data type and its comparison with the varchar(n) data type.
Read more >
EIP C++ API not checking MIN length of varchar attribute
In min/max check for short, long, and varChar, we check for any attribute whose bDoMinMaxCheck flag is set to true instead of only...
Read more >
How can I display a varchar(max) data field without it being ...
I have data that is stored in SQL server as varchar(max). Each record is the text from a news article. I built a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found