· 7 years ago · Oct 24, 2018, 08:30 PM
1USE tempdb;
2GO
3
4DROP TABLE IF EXISTS dbo.NonUnicode;
5DROP TABLE IF EXISTS dbo.Unicode;
6CREATE TABLE dbo.NonUnicode (NU varchar(1) NOT NULL DEFAULT 'a')
7CREATE TABLE dbo.Unicode (U nvarchar(1) NOT NULL DEFAULT N'a');
8
9INSERT INTO dbo.NonUnicode (NU) DEFAULT VALUES;
10INSERT INTO dbo.Unicode (U) DEFAULT VALUES;
11
12SELECT NU FROM dbo.NonUnicode;
13SELECT U FROM dbo.Unicode;
14
15-- Turn on 'Actual Execution Plan'.
16SELECT NU, U
17FROM dbo.NonUnicode
18JOIN dbo.Unicode
19 ON dbo.NonUnicode.NU = dbo.Unicode.U;