Fetching PKs is a very common solution to the problem that you've mentioned. A very popular solution is to have a table that contains the next key value and a stored procedure to fetch/update it.
CREATETABLE ID (token varchar(40), nextid integer)
GOCREATEPROCEDURE GetNextId
@table varchar(40), @id integerOUTPUTASUPDATE id
SET @id = nextid, nextid = nextid + 1WHERE token = @table
RETURN0GO