|
|
@@ -55,7 +55,7 @@ namespace JLHHJSvr.BLL
|
|
|
public static int GetID(SqlCommand cmd, string key, int step = 1)
|
|
|
{
|
|
|
int rslt = 0;
|
|
|
- cmd.CommandText = "UPDATE Sys_scIdentity SET ScIdentityno = ScIdentityno + @step, @curid = ScIdentityno + @step WHERE Tablename = @idkey";
|
|
|
+ cmd.CommandText = "UPDATE Sys_scIdentity WITH (ROWLOCK, UPDLOCK) SET ScIdentityno = ScIdentityno + @step, @curid = ScIdentityno + @step WHERE Tablename = @idkey";
|
|
|
cmd.Parameters.Clear();
|
|
|
cmd.Parameters.Add("@idkey", SqlDbType.VarChar).Value = key;
|
|
|
cmd.Parameters.Add("@step", SqlDbType.Int).Value = step;
|