SQL Server Generate UNIQUE random string
问题 With help of Zohar Answer, I got SQL function to generate random string but I am facing the problem with duplicate. Query Create FUNCTION [dbo].[MaskGenerator] ( @Prefix nvarchar(4000), -- use null or an empty string for no prefix @suffix nvarchar(4000), -- use null or an empty string for no suffix @MinLength int, -- the minimum length of the random part @MaxLength int, -- the maximum length of the random part @Count int, -- the maximum number of rows to return. Note: up to 1,000,000 rows