title: How to list random numbers for each row
body: <p>I have created an insert into with a select table where what I want it to do is give a random 'PlayerWeighting for each player between 0-99. However the problem I have is that instead of randomizing a player weighting for each row, it seems to do it for each team a player is in. For example:</p>
  
  <pre><code>PlayerID   FirstName     Surname     PlayerWeighting  TeamID
  1          Chelsea       Player1     87               1
  2          Chelsea       Player2     87               1
  3          Chelsea       Player3     87               1
  4          Liverpool     Player1     73               2
  5          Liverpool     Player2     73               2
  </code></pre>
  
  <p>I instead want it to do something like this:</p>
  
  <pre><code>PlayerID   FirstName     Surname     PlayerWeighting  TeamID
  1          Chelsea       Player1     87               1
  2          Chelsea       Player2     73               1
  3          Chelsea       Player3     62               1
  4          Liverpool     Player1     90               2
  5          Liverpool     Player2     51               2
  </code></pre>
  
  <p>What do I need to change in my query for this to work (NumberID is the number at the end of each string for 'Player'?</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[Player_CreateWholeTeam]
      @TeamID INT
  
  AS
  SET NOCOUNT ON
  BEGIN
  
  
      INSERT INTO dbo.Player (FirstName, Surname, PlayerWeighting, TeamID)
      SELECT TeamName AS FirstName, 'Player' + cast(NumberID AS VARCHAR (10)) AS Surname, CONVERT(INT, (RAND() * 99)) AS PlayerWeighting, @TeamID
          FROM dbo.Team t
          CROSS JOIN dbo.Number n
          WHERE TeamID = @TeamID
          AND n.NumberID &lt;= 20
  
  END
  </code></pre>