How to convert Nvarchar column to INT

CONVERT takes the column name, not a string containing the column name; your current expression tries to convert the string A.my_NvarcharColumn to an integer instead of the column content. SELECT convert (int, N’A.my_NvarcharColumn’) FROM A; should instead be SELECT convert (int, A.my_NvarcharColumn) FROM A; Simple SQLfiddle here.

SQL performance: Is there any performance hit using NVarchar(MAX) instead of NVarChar(200)

Strictly speaking the MAX types will always be a bit slower than the non-MAX types, see Performance comparison of varchar(max) vs. varchar(N). But this difference is never visible in practice, where it just becomes noise in the overall performance driven by IO. Your main concern should not be performance of MAX vs. non-MAX. You should … Read more

What’s the SQL national character (NCHAR) datatype really for?

“NATIONAL” in this case means characters specific to different nationalities. Far east languages especially have so many characters that one byte is not enough space to distinguish them all. So if you have an english(ascii)-only app or an english-only field, you can get away using the older CHAR and VARCHAR types, which only allow one … Read more

What are the main performance differences between varchar and nvarchar SQL Server data types?

Disk space is not the issue… but memory and performance will be. Double the page reads, double index size, strange LIKE and = constant behaviour etc Do you need to store Chinese etc script? Yes or no… And from MS BOL “Storage and Performance Effects of Unicode” Edit: Recent SO question highlighting how bad nvarchar … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)