select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

CREATE VIEW dbo.vUnconstrainedRandomInt WITH SCHEMABINDING AS/*************************************************************************************************** Returns an unconstrained random integer suitable for use virtually anywhere including in a function***************************************************************************************************/ SELECT UnconstrainedRandomInt = ABS(CHECKSUM(NEWID()));GO CREATE FUNCTION dbo.tvfRandomNumberList/*************************************************************************************************** Function returns a list of randomly generated numbers with a UniqueKey. @pMinValue = the mimiumn value of the random numbers generated. @pMaxValue = the maximum value of the random numbers generated. @pSize = the number of random numbers to be returned. This code is a direct replacement for the CLR function which may be found at the following URL. http://www.sqlwithcindy.com/2013/04/elegant-random-number-list-in-sql-server.html***************************************************************************************************/--===== Declare the I/O for this function ( @pMinValue INT, @pMaxValue INT, @pSize INT )RETURNS TABLE WITH SCHEMABINDING AS--===== Create and return the random number list RETURN WITH E1(N) AS ( SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 --10E1 or up to 10 rows ), E3(N) AS (SELECT 1 FROM E1 a, E1 b, E1 c) --10E3 or up to 1,000 rows, E9(N) AS (SELECT 1 FROM E3 a, E3 b, E3 c) --10E9 or up to 1,000,000,000 rows SELECT TOP (@pSize) UniqueKey = ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) , RandomNumber = ri.UnconstrainedRandomInt %(@pMaxValue-@pMinValue+1) +@pMinValue FROM E9, dbo.vUnconstrainedRandomInt ri;

UPDATE dbo.Client SET RandomNumber = ABS(CHECKSUM(NEWID())) %5 +1;