CRIAR O PROCEDIMENTO [dbo]. [user_insert]
@user_service_unit int,
@user_champion_1 varchar (50),
@user_champion_1_nt varchar (10),
@user_champion_2 varchar (50),
@user_champion_2_nt varchar (10),
@user_champion_3 varchar (50),
@user_champion_3_nt varchar (10),
datetime @user_date_received,
@user_requestor varchar (255),
texto @user_info_requested,
datetime do @user_expiry_date,
datetime de @user_10_days,
datetime de @user_5_days,
datetime de @user_2_days
COMO
INSERÇÃO em dbo.user_details
(user_service_unit, user_champion_1, user_champion_1_nt, user_champion_2, user_champion_2_nt, user_champion_3, user_champion_3_nt,
user_date_received, user_requestor, user_expiry_date, user_10_days, user_5_days, user_2_days)
VALORES
(@user_service_unit, @user_champion_1, @user_champion_1_nt, @user_champion_2, @user_champion_2_nt, @user_champion_3, @user_champion_3_nt,
@user_date_received, @user_requestor, @user_expiry_date, @user_10_days, @user_5_days, @user_2_days);
DECLARAR O @NEW_ID INT
AJUSTAR O @NEW_ID = O SCOPE_IDENTITY ()
INTRODUZIR em dbo.user_info_requested
(user_id, user_info_requested)
VALORES
(@new_id, @user_info_requested)
INSERÇÃO em dbo.user_details_supplied
(user_id, user_details_supplied)
VALORES
(@new_id, '')
INSERÇÃO em dbo.user_questions
(user_id, user_questions)
VALORES
(@new_id, '')
@new_id DO RETORNO
O usuário " desobstruído " 2000 de >
On SQL do class= de GO