/*====== S A L E S R E P 3 ======*/ --Inserting new data DECLARE @OrganizationID int EXEC InsertNewLead @OrganizationID out, 'TmpWorld', '2001/12/10', 'Jim Lambert', 'jiml@tmpworld.com', '2433966', NULL, '2001/12/10' SELECT @OrganizationID AS OrganizationID GO DECLARE @OrganizationID int EXEC InsertNewLead @OrganizationID out, 'StepStone Inc.', '2001/12/11', 'Phil Brady', 'philb@ss.com', '3321421', NULL, '2001/12/11' SELECT @OrganizationID AS OrganizationID GO DECLARE @OrganizationID int EXEC InsertNewLead @OrganizationID out, 'Oakwood Tech.', '2001/12/12', 'Melissa Jones', 'mj@otech.com', '2457501', 'Good deal', '2001/12/12' SELECT @OrganizationID AS OrganizationID GO --Viewing data EXEC ShowMyLeads GO EXEC DeleteLead 2 --Lead with ID 1 is inserted by SalesRep1, so we SalesRep3 should not be able to delete. EXEC DeleteLead 9 --Should be able to delete, since SalesRep3 owns lead with id 9 GO --Lead with ID 1 is inserted by SalesRep1, so we SalesRep3 should not be able to update. EXEC UpdateLead 1, 'TmpWorld', '2001/12/10', 'Jim Lambert', 'jiml@tmpworld.com', '2433966', NULL, '2001/12/10' --Should be able to update, since SalesRep3 owns Lead with id 7 EXEC UpdateLead 7, 'HPS Inc.', '2001/12/10', 'Vikas Paul', 'vpaul@hps.com', '4533966', 'Can''t really trust -- Things are moving', '2001/12/10'