I have a database column that is nvarchar(50). There are some records that might have an em dash in them. I want to find those records.
However, when I copy and paste an em-dash from another program, SQL Server Management Studio treats it like a regular hyphen.
This just returns all the parts with hyphens even though it's an em-dash in between the percent signs:
select * from part
where partnum like '%−%'
How can I make SSMS search for the em-dash and not hyphens?
emdash: −
hyphen: -
In case anyone is wondering this was solved by learning how to use NVARCHAR searches. You can search for something you copy paste from another program by prefixing the search string with an 'N' like this:
SELECT * FROM part
WHERE PartNum LIKE N'%−%'