I have a primary key that I don\'t want to auto increment (for various reasons) and so I\'m looking for a way to simply increment that field when I INSERT. By simply, I mean
declare @nextId int set @nextId = (select MAX(id)+1 from Table1) insert into Table1(id, data_field) values (@nextId, '[blob of data]') commit;
But perhaps a better approach would be using a scalar function getNextId('table1')