Posted By

zooms on 08/10/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


SQL make random string


 / Published in: SQL
 

  1. declare @ID int = 10000
  2. while @ID < 10010
  3. begin
  4. declare @location varchar(1000) = ''
  5. declare @i int = 0
  6. while @i<1000
  7. begin
  8. SET @location = @location + char(33 + cast(ceiling(rand() * 80) AS int))
  9. SET @i = @i+1
  10. end
  11.  
  12. SELECT @location
  13. SET @ID = @ID +1
  14. end

Report this snippet  

You need to login to post a comment.