UPDATE BOOKINGSSET DepartureDateCASE WHEN RAND() Result = Between 0 and 0.3 = Departure Date will be 2 Nights Later CASE WHEN RAND() Result = Between 0.3 and 0.4 = Departure Date will be 3 Nights LaterCASE WHEN RAND ()Result >0.4 = Departure Date will be either 1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28 Nights Later

UPDATE bSET DepartureDate = DATEADD(day, dbo.RN_MULTINOMIAL(@MultinomialProbabilities, URN), Arrivaldate)FROM BOOKINGS bCROSS APPLY (SELECT URN=RAND(CHECKSUM(NEWID()))) a

Round(Rand(CHECKSUM(NEWID())) * 28,0) END END,ArrivalDate)

;WITH TwoDays AS(SELECT TOP 30 PERCENT Booking,ArrivalDate,DepartureDate FROM BookingsORDER BY NEWID())UPDATE TwoDaysSET DepartureDate=DATEADD(day, 2,ArrivalDate) ;;WITH ThreeDays AS(-- we have reduced the set by 30%, so 20% is now ~28% of the remaining 70%-- if you want to be more accurate about the percentages, just count the rows and precalculate how many you wantSELECT TOP 28 PERCENT Booking,ArrivalDate,DepartureDate FROM BookingsWHERE DepartureDate IS NULLORDER BY NEWID())UPDATE ThreeDaysSET DepartureDate=DATEADD(day, 3,ArrivalDate) ;;WITH Remainder AS(-- we have reduced the set by 50%, so everything else is either 1 4 or 28 days-- depending on your definition of random, we could just say 1/3 of the remaining stays are 1 day, 1/3 are 4 days and 1/3 are 28 daysSELECT Booking,ArrivalDate,DepartureDate,1 + (ROW_NUMBER() OVER(ORDER BY NEWID()) % 3) AS SegmentFROM BookingsWHERE DepartureDate IS NULL)UPDATE RemainderSET DepartureDate=DATEADD(day,Case Segment WHEN 1 THEN 1 WHEN 2 THEN 4 WHEN 3 THEN 28 END,ArrivalDate) ;-- Cancel 15%;WITH Cancellations AS(SELECT TOP 15 PERCENT Booking,CancelledFROM BookingsORDER BY NEWID())UPDATE CancellationsSET Cancelled={whatever you want to put in here}

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