Tuesday, 27 September 2016

Generate random alphanumeric string using sql server Comma table exp



WITH n(n) AS (
SELECT 1 UNION ALL SELECT n+1 FROM n WHERE n<62
)
SELECT LEFT(
(SELECT ''+SUBSTRING('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZqwertyuiopasdfghjklzxcvbnm',n,1)

FROM n ORDER BY NEWID() FOR XML PATH('')),25)


//result//

//zV0hOY7bpqNJcAMjUakg1BnyX

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...