GENERARE LA PROCEDURA [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),
testo @user_info_requested,
datetime del @user_expiry_date,
datetime di @user_10_days,
datetime di @user_5_days,
datetime di @user_2_days
AS
INSERTO in 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)
VALORI
(@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);
DICHIARARE IL @NEW_ID INT
REGOLARE IL @NEW_ID = SCOPE_IDENTITY ()
INSERIRE in dbo.user_info_requested
(user_id, user_info_requested)
VALORI
(@new_id, @user_info_requested)
INSERTO in dbo.user_details_supplied
(user_id, user_details_supplied)
VALORI
(@new_id, '')
INSERTO in dbo.user_questions
(user_id, user_questions)
VALORI
(@new_id, '')
@new_id DI RITORNO
Assistente " libero " 2000 di >
On SQL del class= di GO