• Peter, i have got one doubt actually.. not related to the OP's request, but general doubt..

    in your code , you have given the INSERT statement as

    INSERT INTO @MissingNumbers

    VALUES (1),(2),(4),(5),(7),(8),(11),(12),(13),(15),(17),(19),(20)

    When i tried running it, it said there was syntax error near this..I, infact, seen this code, in many more place.. For INSERT statements, all i use till date was like INSERT INTO TABLE SELECT UNION ALL SELECT or INSERT INTO TABLE VALUES INSERT INTO TABLE VALUES..

    Am i missing something in SSMS? How did this code work for you? Are there any special settings tat need to be done for using INSERT statement like that??