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
1 answer

NVARCHAR2 is being represented as hex

I have an NVARCHAR2 field in Oracle and I'm doing a LISTAGG and appending some text to it. LISTAGG( CASE WHEN a.is_dead = 'Y' AND a.death_cause IS NOT NULL AND a.death_date IS NOT NULL THEN a.composite_pednum || ' - ' || a.death_cause || ' ('…
dokgu
  • 4,957
  • 3
  • 39
  • 77
2
votes
1 answer

Calculating SHA1 hash of a 'nvarchar' string using T-SQL

I'm trying to calculate SHA1 hash of a unicode string using T-SQL. The below code works fine with ASCII strings: declare @input varchar(50) set @input = 'some text' print 'SHA1 Hash: ' + UPPER(master.dbo.fn_varbintohexsubstring(0, HashBytes('SHA1',…
Xaqron
  • 29,931
  • 42
  • 140
  • 205
2
votes
0 answers

SQLServerBulkCopy PostgreSQL to MS-SQL Server for NVARCHAR

I am trying to use SQLServerBulkCopy for migrating data from PostgreSQL to MS-SQL Server. I am facing problem for non-English characters (Unicode). To store these data, in PostgreSQL text datatype and for MS-SQL, nvarchar is used. This is the code…
suraj1291993
  • 474
  • 1
  • 5
  • 15
2
votes
3 answers

SQL Command to insert Chinese Letters

I have a database with one column of the type nvarchar. If I write INSERT INTO table VALUES ("玄真") It shows ¿¿ in the table. What should I do? I'm using SQL Developer.
Justin Holze
  • 181
  • 1
  • 2
  • 11
2
votes
1 answer

Can't store other language data in nvarchar column

I am using SQL Server 2008. This is my Table definition. create table myTable (nid int identity(1,1),content nvarchar(max)); when I execute these two queries insert into myTable(content)values(N'हिंदी में परीक्षण'); update myTable set…
rexroxm
  • 868
  • 1
  • 9
  • 26
2
votes
5 answers

nVarchar and SqlParameter

I'm developing an application which must support several languages. To solve the special characters problem I'm using NVarhcar for my text fields. So my SQL query for a text field is insert into tbl_text(text)values(N'Chci tančit v oblasti') My…
André
  • 21
  • 1
  • 1
  • 2
2
votes
1 answer

SQL Server adds b'...' to the jwt tokens I store

I am storing JWT tokens used in authentication for a web service in a SQL Server database. I've declared the column that holds the tokens as type nvarchar(max) and am passing them into the database as simple strings. When I insert the token, SQL…
datacathy
  • 125
  • 2
  • 11
2
votes
1 answer

Pyodbc + FreeTDS + SQL Server + unicode chars insert to nvarchar column in python 2.7 issue - 'HY000',

I am using pyodbc in python 2.7 to insert some unicode chars to a nvarchar column in SQL Server. I am not successful. I am not very familiar with SQL Server. My code: import pyodbc import string import sys import codecs import os import…
PraveenK
  • 163
  • 2
  • 11
2
votes
4 answers

Read comma separated string in Sql server in loop

I have nvarchar data like this: '20030,20031,20033,20034,20065,20045,20044' I want to read all this by spliting into array or read one by one in spliting process and do further process. I have tried this good article but not able to do it.
3 rules
  • 1,359
  • 3
  • 26
  • 54
2
votes
1 answer

SQL Server - DB Impact on VARCHAR and NVARCHAR

SQL Server gives super easy options for developers to create VARCHAR and NVARCHAR columns. However, I see for the same data stored in the column, the SQL Server database size is almost double. Of course a little exaggerating but the database size…
Anand
  • 116
  • 1
  • 6
2
votes
1 answer

How to insert data type nvarchar more than 4000 characters in SQL Server CE?

I insert string with more than 4000 characters into a nvarchar column, so SQL Server CE is throwing an error. I know ntext can store more than 4000 characters, but it almost support in future. How way can I insert string with more than 4000…
2
votes
1 answer

Storing Emojis in SQL Tables

I am working with a SQL Server 2008 database on a Windows 2008 Server. Anytime I try to store an emoji in my table it converts it to a weird looking box. When I try to store the same emoji in SQL Server 2012 it stores the emoji fine. Is it not…
Dwight
  • 93
  • 1
  • 9
2
votes
2 answers

How to correct this T-SQL syntax to get an output with no decimal places?

I am using SQL Server 2016 and I have the following T-SQL code in my query: CAST(ROUND([Count of Bookings] * 100.0 / SUM([Count of Bookings]) OVER (PARTITION BY [Market Final], [PropertyCode]), 0) AS NVARCHAR(15)) + '%' An example of the current…
user3115933
  • 4,303
  • 15
  • 54
  • 94
2
votes
1 answer

nvarchar to utf 8 encoding format conversion in Microsoft sql server

I have varchar value in sql server. I want to see this value in utf-8 encoding format. Can anyone please tell me how to convert nvarchar to utf-8 in Microsoft sql server?
vkreddy
  • 181
  • 6
  • 18
2
votes
4 answers

Selecting not null column

I have a table with varbinary(max) column and nvarchar(max) column. One of them is null and the other has a value. I would like to return the column that has the value as a varbinary(max) column. So far I have tried this, that does not work: SELECT…
Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252