I am currently trying to convert all columns in all tables of my database from char to nvarchar in SQL server 2012.
the query I am trying to run is
select cast((select COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where DATA_TYPE = 'char') as nvarchar(MAX))
Not sure if I should be changing the data type through INFORMATION_SCHEMA.COLUMNS but I found this to be the best way to grab the datatype.
the error I am currently getting is:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Is there a better way to accomplish this or a way around this error, as it seems it doesn't like me changing datatypes to multiple rows at the same time.