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}