Below are the steps of converting an nvarchar colum to INT in sql:
1.Using CAST():
SELECT CAST(your_nvarchar_column AS INT) AS your_int_column from your_table;
2.Using CONVERT():
SELECT CONVERT(INT, your_nvarchar_column) AS your_int_column from your_table;
Example:
A table named employees with a column salary of type nvarchar that you want to convert to INT:
SELECT CAST(marks AS INT) AS marks_int FROM studentmarks;
Note:
Ensure that all nvarchar values are numeric before conversion; use TRY_CAST() or TRY_CONVERT() for safer handling. Always back up your data before schema changes, and always validate convertible values with functions like ISNUMERIC(). If you are changing the column type permanently, then use ALTER TABLE after verifying the validity of the data.