How To Enter Unicode Character String Literals in MS SQL Server?
Submitted by: AdministratorUnicode characters are multi-byte characters. They are very hard to be entered as string literals, because it requires:
* The SQL client tool to support Unicode characters. The command line tool 'sqlcmd' does not support Unicode. But SQL Server Management Studio does support Unicode.
* A special Unicode character input tool to allow you to enter multi-byte Unicode characters.
But if you know the code value of a Unicode character, you can enter it with the help of the NCHAR(int) function. For example:
-- A Unicode string of some interesting characters
PRINT NCHAR(9733)+NCHAR(9734)+NCHAR(9792)+NCHAR(9794);
GO
Run the sample statement with SQL Server Management Studio, you should see some Unicode characters.
Submitted by: Administrator
* The SQL client tool to support Unicode characters. The command line tool 'sqlcmd' does not support Unicode. But SQL Server Management Studio does support Unicode.
* A special Unicode character input tool to allow you to enter multi-byte Unicode characters.
But if you know the code value of a Unicode character, you can enter it with the help of the NCHAR(int) function. For example:
-- A Unicode string of some interesting characters
PRINT NCHAR(9733)+NCHAR(9734)+NCHAR(9792)+NCHAR(9794);
GO
Run the sample statement with SQL Server Management Studio, you should see some Unicode characters.
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | How To Select Some Specific Rows from a Table in MS SQL Server? |
☺ | How To Find Out What Is the Default Collation in a Database? |
☺ | How to download Microsoft SQL Server 2005 Express Edition? |
☺ | How To Use Subqueries with the EXISTS Operators in MS SQL Server? |
☺ | How To Write Character String Constants or Literals in MS SQL Server? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Sybase Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |