Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql Server 2008 NVARCHAR length -1

what does it means if the length is -1 ?

here is my tbl structure

Name    nvarchar    no  -1
like image 788
Nick Kahn Avatar asked Dec 22 '22 01:12

Nick Kahn


2 Answers

As JNK pointed out in the comments, it means MAX:

Name NVARCHAR(MAX)

From MSDN:

-1 = Column data type is varchar(max), nvarchar(max), varbinary(max), or xml.

like image 191
vcsjones Avatar answered Mar 02 '23 00:03

vcsjones


-1 in sys.columns indicates (max).

I confirmed this by making a test table and querying sys.columns:

CREATE TABLE dbo.t (testcol nvarchar(max))

select *
from sys.columns WHERE object_id = object_id('dbo.t')
like image 30
JNK Avatar answered Mar 02 '23 00:03

JNK