I offer this answer which I adapted from this post...
-- Build the table
SELECT 123 as Guy_ID
,0 as Guy_Checked INTO SantaGuys;
INSERT INTO SantaGuys VALUES (234, 1);
INSERT INTO SantaGuys VALUES (456, 0);
INSERT INTO SantaGuys VALUES (567, 1);
GO
-- Create a view of RAND() to work around the Invalid use of side-effecting error
CREATE VIEW v_get_rand_id
AS
SELECT RAND() as rand_id;
GO
-- Build the function with parameters that will be in your SELECT query
CREATE FUNCTION dbo.get_rand_id(@my_Guy_ID as int, @my_Guy_Checked as int)
RETURNS float
AS
BEGIN
DECLARE @my_rand_id float;
SET @my_rand_id = (SELECT CASE WHEN @my_Guy_Checked <> 1
THEN v.rand_id
ELSE 0 END as my_rand_id
FROM v_get_rand_id v)
RETURN @my_rand_id;
END;
GO
-- Run your query and enjoy the results
SELECT sg.Guy_ID
,sg.Guy_Checked
,dbo.get_rand_id(sg.Guy_ID, sg.Guy_Checked) as my_rand_id
FROM SantaGuys sg;
Here is one result...
+--------+-------------+-----------------+
| Guy_ID | Guy_Checked | my_rand_id |
+--------+-------------+-----------------+
| 123 | 0 | 0.5537264103585 |
| 234 | 1 | 0 |
| 456 | 0 | 0.227823559345 |
| 567 | 1 | 0 |
+--------+-------------+-----------------+
Generate ASCII tables easily from this link. Hope this helps