Created
October 24, 2018 13:18
-
-
Save shaneis/00a9ab3a8f5a7efe4a193d7186f6e9b1 to your computer and use it in GitHub Desktop.
Show there is an implicit conversion between N'' and '' types.
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
USE tempdb; | |
GO | |
DROP TABLE IF EXISTS dbo.NonUnicode; | |
DROP TABLE IF EXISTS dbo.Unicode; | |
CREATE TABLE dbo.NonUnicode (NU varchar(1) NOT NULL DEFAULT 'a') | |
CREATE TABLE dbo.Unicode (U nvarchar(1) NOT NULL DEFAULT N'a'); | |
INSERT INTO dbo.NonUnicode (NU) DEFAULT VALUES; | |
INSERT INTO dbo.Unicode (U) DEFAULT VALUES; | |
SELECT NU FROM dbo.NonUnicode; | |
SELECT U FROM dbo.Unicode; | |
-- Turn on 'Actual Execution Plan'. | |
SELECT NU, U | |
FROM dbo.NonUnicode | |
JOIN dbo.Unicode | |
ON dbo.NonUnicode.NU = dbo.Unicode.U; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment