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

Unable to execute query - Error: Incorrect syntax near 'Media'

This code is showing an error: Incorrect syntax near 'Media'. What does it mean? Where am I making a mistake? if (!IsPostBack) { if (Request.QueryString["sub"] != null) { SqlDataAdapter da = new SqlDataAdapter( "select…
Firoz Khan
  • 623
  • 1
  • 9
  • 23
-1
votes
1 answer

Can't compare Unicode characters from different version of Unicode. SQL server

I have 2 tables Table1 : EmployeeID nvarchar(20), EmployeeName nvarchar(50) (created by somebody few years ago.) Table2 : EmployeeID nvarchar(20), EmployeeName nvarchar(50) (I recently created to update the…
Frzzy
  • 299
  • 1
  • 2
  • 16
-1
votes
2 answers

Cannot convert data type nvarchar to numeric

get this error to the txtNum.Text i dont know what to do i already tried the Convert.ToInt32 and SqlDbType.Int but it doesnt work please help me the total has a $ sign in it maybe that's the problem. the Total's DataType is Decimal com = new…
Rohan21
  • 353
  • 5
  • 9
  • 24
-1
votes
1 answer

I am not able to find age by using year in SQL Server 2005?

I am writing a query as following SELECT DATEDIFF(year,Clmn_Dob,getdate()) AS DiffDate FROM tblABCD where Clmn_Dob is a NVARCHAR column. I want to find the age based on date of birth. But instead of this I am getting an error Arithmetic overflow…
Anjali
  • 1,680
  • 4
  • 26
  • 48
-1
votes
1 answer

want to store varbinary value in nvarchar datatype?

My table testuidpwd have: User: Uid Password Passwordhash ---------------------------------------- 121 wrwrwr 0x0013531FA845AEA1E840BDE787336ED3CAEDFE6E 122 etetxw 0x79BAEFD23C2F4D146F9BD2FDF6C14CA25AC5D6AA uid char data type password…
-2
votes
3 answers

Convert Nvarchar Datatype to Datetime

I am practicing on a database on SQL server where the date column in the table is Nvarchar(255) thereby presenting the dates as five digit numbers eg 40542,40046 etc. How do I change the dates in the column to actual dates? The articles I checked…
-2
votes
1 answer

Converting NVARCHAR to DECIMAL: All decimals lost

I am loading data from a CSV file to a staging table (using BULK INSERT) where all column types are NVARCHAR(100). This works well. The idea is then to insert that data into the productive table and while doing that changing the data types. When…
jayjay
  • 13
  • 2
-2
votes
2 answers

Why EF Core 3.1 StringLength Attribute doubles SQL column length

Am using EF core 3.1 Code first approach. When i specify [StringLength(51)] for a data model param, the equivalent SQL column length is specified as nvarchar(102). Why is it getting doubled? What should i do to get same maximum length in SQL column…
Raj
  • 319
  • 1
  • 3
  • 18
-2
votes
2 answers

How to implement MAX function on a text column in SQL Server?

I'm using SQL Server 2005 and have a column that contains serial numbers, which are nvarchar(50). My problem is selecting max(serial_no) from the table. The serial numbers used to have a length of 7 only but new ones are now 15. Whenever I select…
sabre
  • 207
  • 6
  • 18
-2
votes
1 answer

Update Query with NVARCHAR(max) in SQL Server

Have an issue with SQL Server performance and wanted to see if anyone can give some tips about improving the performance of an update query. What I'm doing is updating one table with data from another table. Here's some of the basics: SQL Server…
mdjtlj
  • 57
  • 1
  • 5
-3
votes
1 answer

Concat and make a string into a date

I have a table where the month and year are separate, and I want to put them together and make the backend format to date. I tried cast/converting but I get an error of "Conversion failed when converting date and/or time from character string" This…
cardonas
  • 109
  • 1
  • 1
  • 9
-3
votes
1 answer

Can I use "/" operator on nvarchar column type in SQL Server Management Studio?

I am trying to divide 2 columns which are defined as nvarchar, but SSMS throws an error saying you can not use / operator on nvarchar. select location, date, total_cases, total_deaths, (total_deaths / total_cases) * 100 from …
-3
votes
1 answer

To handle special characters in SQL server database, which should be used varchar or nvarchar?

I am asking a simple question that, to handle special characters in my Mobile/Tablet web app, which data types should I use? Varchar NVarchar Text NText EDIT: IMPORTANT! ntext, text, and image data types will be removed in a future version of SQL…
TAB
  • 1,944
  • 8
  • 28
  • 45
-3
votes
1 answer

varchar and nvarchar are not supported in PostgreSQL?

While creating table using pgAdmin (PostgreSQL UI), I could see that name are getting datatype as text. Which means in PostgreSQL there is no support for varchar and nvarchar ? If so, please suggest what are the datatypes that will not supported by…
Shesha
  • 1,857
  • 6
  • 21
  • 28
-3
votes
1 answer

PostgreSQL: Can we use "varchar" instead of "nvarchar" in PostgreSQL?

Can we use varchar instead of nvarchar for same use in PostgreSQL? Because I am unable to use nvarchar in PostgreSQL.
Sarfaraz Makandar
  • 5,933
  • 16
  • 59
  • 84
1 2 3
32
33