eg:
INSERT INTO Users
(St_ID, Us_User, Us_Password, Us_Term, Us_State, Us_Group, Ex_Receipt)
select '5817', '04105817', 'x', '2004-2-28', 'Enable', 'abc', '7'
union all
select '5818', '04105818', 'x', '2004-2-28', 'Enable', 'abc', '8'
union all
select '5819', '04105819', 'x', '2004-2-28', 'Enable', 'abc', '9'
INSERT INTO Users
(St_ID, Us_User, Us_Password, Us_Term, Us_State, Us_Group, Ex_Receipt)
select '5817', '04105817', 'x', '2004-2-28', 'Enable', 'abc', '7'
union all
select '5818', '04105818', 'x', '2004-2-28', 'Enable', 'abc', '8'
union all
select '5819', '04105819', 'x', '2004-2-28', 'Enable', 'abc', '9'
select St_ID+newid , '0'+ cast(cast(Us_User as int)+newid as varchar(10)), Us_Password, Us_Term, Us_State, Us_Group, Ex_Receipt
from users ,#
St_ID, Us_User,Ex_Receipt 应都为INT
NSERT INTO Users
(St_ID, Us_User, Us_Password, Us_Term, Us_State, Us_Group, Ex_Receipt)
select IDENTITY(smallint, (select max(St_id) from users)+1, 1) AS St_id, IDENTITY(smallint, (select max(St_id) from users)+1, 1) AS Us_User, 'x', '2004-2-28', 'Enable', 'abc', '7'
union all
select IDENTITY(smallint, (select max(St_id) from users)+1, 1) AS St_id, IDENTITY(smallint, (select max(St_id) from users)+1, 1) AS Us_User, 'x', '2004-2-28', 'Enable', 'abc', '8'