0

I have a [TABLE] with 3 columns like this:

[Column1-smallint] [Column2-nvarchar] [Column3-nvarchar]

I would like to create a new view with only 1 column like this:

[Column1 & Column2 & Column3]

If I try:

SELECT [Column1 & Column2 & Column3] AS [NewColumnName] FROM dbo.table

It complains about Conversion failed when converting the nvarchar data type smallint

How do I force convert everything to NVARCHAR in the new view?

Level1Coder
  • 245
  • 2
  • 10

1 Answers1

2

Perhaps this is sufficient enough for your needs:

SELECT (CONVERT(nvarchar, Column1) + CONVERT(nvarchar, Column2) + CONVERT(nvarchar, Column3)) AS[NewColumnName] FROM dbo.Table
gojj
  • 98
  • 1
  • 3
  • 11