How to convert Nvarchar column to INT in sql

How to convert Nvarchar column to INT in SQL

Your current expression tries to convert the string B.Your_NvarcharColumn to an integer instead of the column content. CONVERT takes the column name, not a string containing the column name:

SELECT convert (int, B.Your_NvarcharColumn) FROM B
SELECT convert (int, N'B.Your_NvarcharColumn') FROM B

2020-05-05