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
2
votes
3 answers

Is there a way to get SQL Server to automatically do selects on hash values of nvarchar fields?

I'm not sure how to better phrase this question so it's possible I missed a previously asked question. Feel free to close this and point me to the correct one if it exists. I have a table with two important columns (that is to say it has much more…
encee
  • 4,544
  • 4
  • 33
  • 35
2
votes
1 answer

Best size of comment - SQL Server

Best length of comment on app is 4000? I want to know standard of social network. How can I show it on SQL Server? Is it must be nvarchar(?) or varchar(?) or ntext or ...? Thanks for your help
Mohi
  • 25
  • 1
  • 1
  • 7
2
votes
0 answers

Unicode characters in SQL Anywhere: VARCHAR(n CHAR) or NVARCHAR(n)

We are using SAP Sybase SQL Anywhere 16 with C#.NET and want to use unicode characters in string fields. When setting up the database with UCA collation, this already works with VARCHAR fields. Unfortunately we had to learn that the max length is…
maf-soft
  • 2,335
  • 3
  • 26
  • 49
2
votes
2 answers

Simple dapper select query with 20 rows(most of columns are nvarchar(max)) taking too long- 15 seconds and more

My dapper code is given below with a select query: const string Sql = @"SELECT [id] ,[groupName] ,[reqCap] ,[impCap] ,[player] …
Manu Mohan
  • 1,694
  • 2
  • 20
  • 31
2
votes
5 answers

nvarchar concatenation problem

I am probably trying to do a simple thing after dealing with all the hard stuff but seems like this is giving me a headache. I am trying to concatenate text into variable @strXml which is an nvarchar variable to build Xml element, but @strXml…
Ashar Syed
  • 1,236
  • 6
  • 16
  • 28
2
votes
1 answer

nvarchar to time conversion

I have to develop system which is accept data (in database) from another system. The problem I face is all DATE and TIME data is in NVARCHAR. I have to convert to DATE and TIME in order to calculate the duration. I am using SQL Server 2008 R2. Data…
Bet
  • 21
  • 1
2
votes
1 answer

LEN and DATALENGTH of VARCHAR and NVARCHAR

After reading "What is the difference between char, nchar, varchar, and nvarchar in SQL Server?" I have a question. I'm using MS SQL Server 2008 R2 DECLARE @T TABLE ( C1 VARCHAR(20) COLLATE Chinese_Traditional_Stroke_Order_100_CS_AS_KS_WS, C2…
2
votes
3 answers

Detect UNICODE characters that are not ASCII in table

I have the following table: Select name, address, description from dbo.users I would like to search all this table for any characters that are UNICODE but not ASCII. Is this possible?
whytheq
  • 34,466
  • 65
  • 172
  • 267
2
votes
3 answers

Error converting data type nvarchar to bigint caused by IN operator in Stored Procedure

Stored Proc: ALTER PROCEDURE [dbo].[MyProcedure] @CommaSeperatedValues nvarchar(500) AS BEGIN SET NOCOUNT ON; SELECT Col1, Col2, Col3 FROM MyTable WHERE SomeCol_BigIntDataType IN (@CommaSeperatedValues) The Value which is…
Miu
  • 33
  • 1
  • 4
2
votes
1 answer

XML to NVarchar(MAX) failing

I have a stored procedure which returns 2 resultset each containing exact one cell. In first one I am returning an xml and in second a datetime value. I tried accessing this SP (SP_XML) from a linked server which failed saying XML not allowed on…
Durgesh Chaudhary
  • 1,075
  • 2
  • 12
  • 31
2
votes
3 answers

SQL Server unique index on nvarchar issue

I have a SQL Server table with a nvarchar(50) column. This column must be unique and can't be the PK, since another column is the PK. So I have set a non-clustered unique index on this column. During a large amount of insert statements in a…
TomTee
  • 91
  • 9
2
votes
1 answer

TSQL reading from file into varchar/nvarhar error

So I decided for the fun of it to read a text file and store the contents into a NVARCHAR using TSQL and the Microsoft SQL Server Management Studio 2008 R2. I found an example for doing this at…
user3003304
  • 288
  • 1
  • 6
  • 18
2
votes
2 answers

Converting datatype Char to Nvarchar

I am currently trying to convert all columns in all tables of my database from char to nvarchar in SQL server 2012. the query I am trying to run is select cast((select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where DATA_TYPE = 'char') as…
user3087290
  • 23
  • 1
  • 3
2
votes
1 answer

Use nvarchar datatype in SQL Server CE with EF code-first

I use SQL Server CE with EF code-first. I have following domain class: public class User:BaseEntity { public User() { this.UserForms = new List(); IsAdmin = false; IsActive = true; } public string…
2
votes
1 answer

Does it matter if I index a column > 900 bytes

So SQL server places a limit of 900 bytes on an index. I have columns that are NVARCHAR(1000) that I need to search on. Full text search of these columns is not required because search will always occur on the complete value or a prefix of the…
spender
  • 117,338
  • 33
  • 229
  • 351