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

Migrating from sql server to Oracle varchar length issues

Im facing a strange issue trying to move from sql server to oracle. in one of my tables i have column defined by NVARCHAR(255) after reading a bit i understod that SQL server is counting characters when oracle count bytes. So i defined my table in…
Noam Shaish
  • 1,613
  • 2
  • 16
  • 37
3
votes
1 answer

Why does SQL Server not behave consistently when dealing with half-emojis?

When an NVARCHAR attribute in a SQL Server database contains an emoji, string functions and operators behave in different ways (default database collation is SQL_Latin1_General_CP1_CI_AS). Behavior of string functions Functions like LEFT() and LEN()…
AHiggins
  • 7,029
  • 6
  • 36
  • 54
3
votes
1 answer

Nvarchar perform better than varchar?

I am really surprisde to see that in my MS SQL table, I am defining a field varchar and doing group by with another table's field. When I do the same thing with the column as nvarchar it is 3 second faster than varchar when, theoretically, varchar…
Shuvra
  • 213
  • 2
  • 15
3
votes
1 answer

View_Definition in INFORMATION_SCHEMA.VIEWS is limited to 4000 characters

I'm backing up all of my views by running this query, and storing the results in a table: select TABLE_CATALOG as DBName , TABLE_NAME as ViewName , VIEW_DEFINITION as ViewDef , datalength(VIEW_DEFINITION) as [Length] , GETDATE() as…
user1916006
  • 31
  • 1
  • 4
3
votes
1 answer

NVarchar(max) to XML parse error

Have the following configuration: Delphi XE7 MS SQL Server 2008 Connection to the SQL server with FireDAC I'm using stored procedures to retrieve tables with all the detail records from SQL server in XML format converted to nvarchar(max). Here is an…
BenjiK
  • 45
  • 4
3
votes
2 answers

Get value of SQL Var conformed on varchar text

I have the next script example: DECLARE @lCode INT DECLARE @lText VARCHAR(400) DECLARE @lConditionName VARCHAR(40) DECLARE @Aux VARCHAR(400) SET @lCode = 1234; SET @lConditionName = 'Code' SET @Aux = '@l' + @lConditionName SET @lText = 'SELECT *…
3
votes
0 answers

Eclipse DTP does not show nvarchar on SQL server

In latest Eclipse (Mars), data sources explorer will not show NVARCHAR types on MS SQL Server data connections. This is true for previous versions as well, along with open-source derivatives such as STS. However, commercial tools such as Rational…
LetsBeFrank
  • 774
  • 11
  • 31
3
votes
1 answer

Is there dataloss from converting from varchar to nvarchar

I have a column in SQL Server that is varchar(MAX). The column has been populated with that data type. I now want to convert the column to nvarchar(MAX) to accept unicode characters. Is there any data loss when I convert this column from…
Leslie Jones
  • 540
  • 2
  • 9
  • 22
3
votes
2 answers

string or binary data would be truncated. in sql server

How to overcome this? I have insert statements for large tables. there were lot of columns in those tables. Is there any simple way to find the column which is causing above error?
Giri Prasad
  • 1,175
  • 2
  • 8
  • 13
3
votes
2 answers

How to get last part of nvarchar with variable size in T-SQL?

Imagine that I have the following value in my nvarchar variable: DECLARE @txt nvarchar(255) SET @txt = '32|foo|foo2|123' Is there a way to easily get the last part just after the last | that is 123 in this case ? I could write a split function but…
Aleph0
  • 470
  • 2
  • 10
  • 27
3
votes
1 answer

PDO not reading nvarchar datatye of MSSQL Server

I have one table in MSSQL Server 2012 whose data type of one column is defined as below: COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE description 2005 nvarchar 1073741823 When I run this query: select * from tablename using PHP…
Neeraj
  • 8,625
  • 18
  • 60
  • 89
3
votes
3 answers

Hibernate with NVARCHAR2

I have table with a column as NVARCHAR2, and I have build my object with hibernate annotations, When i want to insert into DB or fetch from DB the result is something like that "???????", I have implemented a custom Dialect as follows but it did not…
dursun
  • 1,861
  • 2
  • 21
  • 38
3
votes
1 answer

SqlBulkCopy Unicode/UTF8 error

I am using c# SqlBulkCopy functionality to save records with UTF8 encoded multilingual values. My database field is 'NVARCHAR(max)' and my to be saved value is 我多言語で我. But it is saving as '???????' . Is there any way to save this exact…
Gayan Dinuzhka
  • 331
  • 2
  • 5
  • 16
3
votes
1 answer

Select where like nchar or nvarchar

From my experience it seems that select where like on data from my database doesnt work on fields in nchar format but does in nvarchar format. Is this true? If so why and is changing the data type to nvarchar the only work around? I have noticed…
Crouch
  • 846
  • 3
  • 17
  • 32
3
votes
3 answers

Maximum number of nvarchar(max) columns in sql server tables

What is limited of define Nvarchar(max) columns in SQL Server 2008 R2 ? I see this link But, I want get limit number of nvarchar(max) columns in one table.
Ali Ahmadi
  • 2,387
  • 4
  • 31
  • 48