Hi,
I need to Split Domain from (Domain\Username), and inset domain value in a new column. But character (' \ ') will be different in other languages like Japanese, Dutch ... etc.
How can we write a generalized query that will work for any locale / collation.
Below SQL Query will work for English usernames
UPDATE UserProfiles SET Domain = SUBSTRING(username, 1, CHARINDEX('\', username) - 1) where username like '%\%'
Also it Should work on Database : SQL SERVER 2008 R2, 2012, 2014, 2016 & 2017
Please share your thoughts
Thanks
Rajesh Nair