BEGIN TRAN
-- Get the next value
SELECT @value = myValue+1
FROM MyTable
-- Update the value
UPDATE MyTable
SET myValue = @value
COMMIT
-- Use the new value as you need
INSERT INTO AnotherTable (myValueField, anotherField, ...)
VALUES (@value, 'bla bla bla', ...)
So this solution needs to handle the instance where one application is doing reads/writes and if the web does a read, the other application needs to wait.
i'm pretty sure we'd be more helpful in finding a way to achieve your goal without that manual increment at all. what is the id used for ?
it could seem reasonable to increment the value first, and then let the programs do what they need so there is no race conditions at all and little contention so you don't need to bother with priorities...
is incrementing AFTER doing the work actually necessary ?
The read and increment should happen in the same statement.
This might give some good ideas.
https://technet.microsoft.com/en-us/library/jj856598(v=sql.110).aspx
With databases (in general) the terms to search for include "lock" and "transaction." Those, together with "MSSQL" might be helpful for you as you look for alternate ideas.