Questions tagged [nvarchar]

Variable-length character data type in Transact-SQL.

Variable-length character data type in Transact-SQL. More info: https://msdn.microsoft.com/en-us/library/ms186939.aspx.

483 questions
13
votes
2 answers

What is the maximum size we can give for nvarchar in sqlite?

In SqlServer we can use NVarchar(MAX) but this is not possible in sqlite. What is the maximum size I can give for Nvarchar(?)?
JPReddy
  • 63,233
  • 16
  • 64
  • 93
12
votes
3 answers

ORA-12704: character set mismatch when performing multi-row INSERT of nullable NVARCHAR's

Consider the following table where one of the columns is of type nullable NVARCHAR: CREATE TABLE CHARACTER_SET_MISMATCH_TEST ( ID NUMBER(10) NOT NULL, VALUE NVARCHAR2(32) ); Now, I want to insert multiple data tuples into this table using…
Bass
  • 4,977
  • 2
  • 36
  • 82
12
votes
3 answers

How does SQL Server store more than 4000 characters in NVARCHAR(max)?

I have defined a stored procedure that has a parameter of type NVARCHAR(max) and I process that string in my stored procedure. I know that max of nvarchar is 4000. But I have passed a string with 5700 characters to my sp with no errors. Is it…
Bob
  • 22,810
  • 38
  • 143
  • 225
11
votes
2 answers

NVARCHAR(?) for Email addresses in SQL Server

For Email addresses, how much space should I give the columns in SQL Server. I found this definition on Wikipedia: http://en.wikipedia.org/wiki/Email_address The format of email addresses is local-part@domain where the local-part may be up to 64…
tugberk
  • 57,477
  • 67
  • 243
  • 335
11
votes
6 answers

Limiting NVARCHAR size in SQLServer?

I was wondering what would be the consequences of setting NVARCHAR fields to MAX instead of a specific size in SQL Server 2008, and limiting the input from the application's logic. Also, would these be a bad design practice?
kjv
  • 11,047
  • 34
  • 101
  • 140
11
votes
2 answers

How to return an nvarchar(max) in a CLR UDF?

Assuming following definition: /// /// Replaces each occurrence of sPattern in sInput with sReplace. This is done /// with the CLR: /// new RegEx(sPattern, RegexOptions.Multiline).Replace(sInput, sReplace). /// The result of the…
Daren Thomas
  • 67,947
  • 40
  • 154
  • 200
10
votes
2 answers

Inserting special characters (greater/less than or equal symbol) into SQL Server database

I am trying to insert ≤ and ≥ into a symbol table where the column is of type nvarchar. Is this possible or are these symbols not allowed in SQL Server?
user1610304
  • 103
  • 1
  • 1
  • 5
9
votes
1 answer

FluentNHibernate and VARCHAR Columns

I am starting a simple .NET project with FluentNhibernate. I've followed few examples I've found on the Internet and it seems quite easy to grasp. I've realized that if I let FluentNhibernate build my DB schema (Sql Server 2000) it generates…
LeftyX
  • 35,328
  • 21
  • 132
  • 193
9
votes
1 answer

Using indexes with NVarchar(50) vs. NVarchar(255) column?

We have an indexed column (ModelName) which has a big importance in the table and is very similar to a "Catalog Number", but it's not the PK. a lot of ORDER by ModelName ; WHERE ModelName etc, is being used. The column originally started as …
ZigiZ
  • 2,480
  • 4
  • 25
  • 41
9
votes
5 answers

The data types ntext and nvarchar are incompatible in the equal to operator

I have a problem and i dont know how to fix it. I have a simple table in database CREATE TABLE [dbo].[home] ( [Id] INT NOT NULL, [text] NTEXT NOT NULL, PRIMARY KEY CLUSTERED ([Id] ASC) ); I`m using FormView in visual studio 2012,…
user3224399
  • 91
  • 1
  • 1
  • 3
9
votes
1 answer

Linq to SQL nvarchar problem

I have discovered a huge performance problem in Linq to SQL. When selecting from a table using strings, the parameters passed to sql server are always nvarchar, even when the sql table is a varchar. This results in table scans instead of seeks, a…
Craig
  • 228
  • 1
  • 3
  • 7
8
votes
5 answers

T-SQL: How to obtain the exact length of a string in characters?

I'm generating T-SQL SELECT statements for tables for which I have no data type information up-front. In these statements, I need to perform string manipulation operations that depend on the length of the original value of the tables' columns. One…
Fabian Schmied
  • 3,885
  • 3
  • 30
  • 49
8
votes
2 answers

Determine varchar content in nvarchar columns

I have a bunch of NVARCHAR columns which I suspect contain perfectly storable data in VARCHAR columns. However I can't just go and change the columns' type into VARCHAR and hope for the best, I need to do some sort of check. I want to do the…
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
7
votes
2 answers

Inserting national characters into an oracle NCHAR or NVARCHAR column does not work

When inserting strings in an oracle database, some national characters are replaced with question marks, even though they are inserted in an NCHAR or NVARCHAR column - that should be able to handle all Unicode characters. This happens using either…
KarlP
  • 5,149
  • 2
  • 28
  • 41
7
votes
2 answers

How to decode nvarchar to text (SQL Server 2008 R2)?

I have a SQL Server 2008 R2 table with nvarchar(4000) field. Data that stores this table look like '696D616765206D61726B65643A5472' or '303131' ("011"). I see that each char is encoding to hex. How can I read those data from table? I don't want…
xieergai
  • 165
  • 2
  • 6
1 2
3
32 33