I'm trying to populate 3 columns all rows with some random ints.
The code below has an error
Incorrect syntax near "@Upper. Expecting ( or Select
What am I doing wrong?
---- Create the variables for the random number generation
DECLARE @Random INT;
DECLARE @Upper INT;
DECLARE @Lower INT
---- Create a random number between 1 and 111
SET @Lower = 1 -- The lowest random number
SET @Upper = 111 -- The highest random number
UPDATE [tblProject]
SET
[ContractorID1] = @Random = ROUND(((@Upper - @Lower -1) * RAND() + @Lower), 0) -- error
,[ContractorID2] = @Random = ROUND(((@Upper - @Lower -1) * RAND() + @Lower), 0) -- error
,[ContractorID3] = @Random = ROUND(((@Upper - @Lower -1) * RAND() + @Lower), 0) -- error