Basically, don't.
It's a bad idea to do this kind of thing at all, but to do it in a multiuser database system (And MySQL and SQL Server as both multiuser) is just asking for trouble because as soon as you get two or more users doing this, you get duplications, and they can cause some horrible problems for a human to sort out.
Instead, use an
IDENTITY column[
^] and let the database system sort out sequential and unique numbers for you!