Last active
July 9, 2022 21:19
-
-
Save BrentOzar/9b08b5ab2b617847dbe4aa0297b4cd5b to your computer and use it in GitHub Desktop.
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
CREATE DATABASE [٠০౦০٠]; | |
GO | |
USE [٠০౦০٠]; | |
GO | |
CREATE SCHEMA [٠০౦০٠]; | |
GO | |
CREATE TABLE [٠০౦০٠].[٠০౦০٠]([٠০౦০٠] NVARCHAR(20), [۰০౦০٠] NVARCHAR(20), [٠০౦০۰] NVARCHAR(20), [۰০౦০۰] NVARCHAR(20)); | |
GO | |
CREATE UNIQUE CLUSTERED INDEX [٠০౦০٠] ON [٠০౦০٠].[٠০౦০٠]([٠০౦০٠], [۰০౦০٠], [٠০౦০۰], [۰০౦০۰]); | |
GO | |
INSERT INTO [٠০౦০٠].[٠০౦০٠]([٠০౦০٠], [۰০౦০٠], [٠০౦০۰], [۰০౦০۰]) | |
VALUES (N'[۰০౦০٠]', N'[۰০౦০٠]', N'[٠০౦০۰]', N'[۰০౦০۰]'); | |
GO | |
CREATE VIEW [٠০౦০٠].[۰০౦০٠] AS SELECT [٠০౦০٠], [۰০౦০٠], [٠০౦০۰], [۰০౦০۰] FROM [٠০౦০٠].[٠০౦০٠]; | |
GO | |
CREATE PROC [٠০౦০٠].[٠০౦০۰] | |
@٠০౦০٠ NVARCHAR(20), | |
@۰০౦০٠ NVARCHAR(20), | |
@٠০౦০۰ NVARCHAR(20), | |
@۰০౦০۰ NVARCHAR(20) AS | |
SELECT [٠০౦০٠], [۰০౦০٠], [٠০౦০۰], [۰০౦০۰] | |
FROM [٠০౦০٠].[۰০౦০٠] | |
WHERE [٠০౦০٠] = @٠০౦০٠ | |
AND [۰০౦০٠] = @۰০౦০٠ | |
AND [٠০౦০۰] = @٠০౦০۰ | |
AND [۰০౦০۰] = @۰০౦০۰ | |
ORDER BY [۰০౦০۰], [٠০౦০۰], [۰০౦০٠], [٠০౦০٠]; | |
GO | |
EXEC [٠০౦০٠].[٠০౦০٠].[٠০౦০۰] | |
@٠০౦০٠ = N'[۰০౦০۰]', | |
@۰০౦০٠ = N'[٠০౦০۰]', | |
@٠০౦০۰ = N'[۰০౦০٠]', | |
@۰০౦০۰ = N'[٠০౦০٠]' | |
GO |
Could an explanation be added on top, explaining this? Google search lead to this here. :D
It's actually "Fun With Unicode", not ASCII.
For rubyFeedback and others, here is the answer:
SELECT sc.name,
UNICODE(SUBSTRING(sc.name, 1,1)) uc1,
UNICODE(SUBSTRING(sc.name, 5,1)) uc5
FROM sys.objects so
JOIN
sys.columns sc on so.object_id = sc.object_id
WHERE so.type = 'U'
and so.name like N'%০౦০%';
Leaving this here since every time I try and find this from memory, I usually end up here and then can't find the blog post it came from:
https://www.brentozar.com/archive/2018/06/stupid-t-sql-tricks/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I really hope I never ever see something like that in the wild!