• Are there any other requirements related to that "reference number"?

    If it is just an integer, then perhaps you could use a SEQUENCE, which is a new feature in SQL Server 2012.

    EDIT: HowardW's answer is more to the point, related to the QUESTION posted 😉

    "Walking on water and developing software from a specification are easy if both are frozen." -- Edward V. Berard, "Life-Cycle Approaches"