CRÉER LE PROCÉDÉ [dbo]. [user_insert]
@user_service_unit international,
@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),
date-heure @user_date_received,
@user_requestor varchar (255),
texte @user_info_requested,
date-heure de @user_expiry_date,
date-heure de @user_10_days,
date-heure de @user_5_days,
date-heure de @user_2_days
AS
INSERTION DANS 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)
VALEURS
(@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) ;
DÉCLARER LE @NEW_ID INTERNATIONAL
PLACER LE @NEW_ID = LE SCOPE_IDENTITY ()
INSÉRER DANS dbo.user_info_requested
(user_id, user_info_requested)
VALEURS
(@new_id, @user_info_requested)
INSERTION DANS dbo.user_details_supplied
(user_id, user_details_supplied)
VALEURS
(@new_id, '')
INSERTION DANS dbo.user_questions
(user_id, user_questions)
VALEURS
(@new_id, '')
@new_id DE RETOUR
Le serveur " clair " 2000 de >