So I'm having a tough time figuring out an issue I'm working on. In short I'm attempting to account for missing data (for metrics reports).

Ex. I'm expecting 12 results per server per 15 min window, when that number isn't met i'd like to insert a record that is simply labeled as Missing with a date and time that corresponds to the missing record on the table.

Is anyone familiar with a scrip that can count batches an insert where a specific number (in this case 12) is not met to meet that goal?

Lets say my table is set up as such:

```
ID   Server   Uptime   CheckTime   Checkdate   Status

1    test1    100       12:15       1/1/13     GOOD

2    test2    100       12:15       1/1/13     BAD

3    test4    100       12:15       1/1/13     GOOD

```

In this case only 3 markers were returned when I am expecting 12. How could I generate the remaining 9 records without a manual process and mark them as missing? The specific ID's aren't that important, the relevant data would be Server, Checkdate, Checktime, and Status.

The idea im thinking so far is something along the lines of this:

```
dbo.tbluptime = a
dbo.tblreportingtabletest = b

Select missing, SERVER, checkdate, checktime from a 

X=a.missing

insert X rows into B
Values (MISSING, a.server, a.checkdate, a.checktime)
where b.server=a.server and b.checkdate=a.checkdate and b.checktime=a.checktime

```

Formatting and syntax nonwithstanding.