Tuesday, 27 September 2016

Generate random string using sql server NEWID() method



declare @password varchar(30)
set @password=(SELECT RIGHT(REPLACE(CONVERT(VARCHAR(36),NEWID()),'-',''),26))

select @password

//REsult//

//B067EC4004AA96ED32476E0DC0

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...