title: How to generate different random 100000 numbers as money type between (0-15000) in sql?
body: <p>I have seen some similar questions, and came up with something like this:</p>
  
  <pre><code>select RAND(CHECKSUM(NEWID()))
  </code></pre>
  
  <p>but the question is when I set it into money type, it loses some digits and then some rows will be the same again.</p>
  
  <p>Following are my entire codes,please give me some advice.    </p>
  
  <pre><code>if(exists(select * from sysobjects where name='dump') )
      drop table [dump]
  
      --create the table
      CREATE table [dump]
      (id int ,name varchar(50), price money)
  
      declare @p money=0
      set @p= RAND(CHECKSUM(NEWID()))*15000
      --set initial value
      INSERT INTO dump
      values(@i,newID(),@p)
      --insert the rows
      WHILE(@i&lt;100000)
  
      begin
      set @p=RAND(CHECKSUM(NEWID()))*15000
      set @i+=1
          INSERT INTO dump
          values(@i,newID(),@p) 
          print 'the nth row：'+cast(@i as varchar(15)) 
      end
  </code></pre>