Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 generate letters randomly

Author  Topic 

vidhya
Posting Yak Master

108 Posts

Posted - 2009-04-25 : 06:10:46
hi friends,

I need of query to generate the alphabetic letters randomly without using function or procedure.

Thanks in Advance.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-25 : 06:19:34
SELECT CHAR(65 + ABS(CHECKSUM(NEWID())) % 26)
FROM master..spt_values
where type = 'P'


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-04-25 : 08:28:15
or

SELECT CHAR(number)
FROM master..spt_values
where type = 'P' and number between 65 and 90
order by newid()


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -