Created
February 7, 2011 16:48
-
-
Save ianoxley/814695 to your computer and use it in GitHub Desktop.
Changes all varchar columns to nvarchar in SQL Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT 'ALTER TABLE [' + TABLE_SCHEMA + '].[' + TABLE_NAME + '] ALTER COLUMN [' + COLUMN_NAME + '] nvarchar(' + CAST(CHARACTER_MAXIMUM_LENGTH As NVARCHAR) + ');' | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE DATA_TYPE = 'VARCHAR'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment