Quantcast
Channel: Jannik Strelow
Viewing all articles
Browse latest Browse all 84

MSSQL int to nvarchar

$
0
0

If you need to convert/cast a database integer field to an nvarchar on a Microsoft SQL Server, you should use the convert function. In this example we cast the number 4343 to an nvarchar:

SELECT
	convert(nvarchar(255), 4343)

Example to convert an int field (field_int) to a nvarchar field:

SELECT field_int,
	convert(nvarchar(255), field_int) as field_as_nvarchar
FROM [TEST].[dbo].[TestTable]

Result from the query:


Viewing all articles
Browse latest Browse all 84

Latest Images

Trending Articles





Latest Images