Randomly capitalize half of a string

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

use master
DECLARE @ varchar(max)='codegolf'

SELECT top(len(@)/2)@=stuff(@,number+1,1,upper(substring(@,number+1,1)))FROM
spt_values WHERE number<len(@)and'P'=type
ORDER BY newid()PRINT @

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results