/*====== S A L E S R E P 2 ======*/ --Inserting new data DECLARE @OrganizationID int EXEC InsertNewLead @OrganizationID out, 'HPS Inc.', '2001/12/10', 'Vikas Paul', 'vpaul@hps.com', '4533966', 'Can''t really trust', '2001/12/10' SELECT @OrganizationID AS OrganizationID GO DECLARE @OrganizationID int EXEC InsertNewLead @OrganizationID out, 'Syntel Inc.', '2001/12/11', 'Mike McLure', 'mikem@syntel.com', '3321531', 'Slow but long-term prospect', '2001/12/11' SELECT @OrganizationID AS OrganizationID GO DECLARE @OrganizationID int EXEC InsertNewLead @OrganizationID out, 'Avaya LLC.', '2001/12/12', 'Sean Jackson', 'sjack@avaya.com', '2447501', 'Good deal', '2001/12/12' SELECT @OrganizationID AS OrganizationID GO --Viewing data EXEC ShowMyLeads GO EXEC DeleteLead 8 --Lead with ID 8 is inserted by SalesRep3, so we SalesRep2 should not be able to delete. EXEC DeleteLead 5 --Should be able to delete, since SalesRep2 owns lead with ID 5 GO --Lead with ID 7 is inserted by SalesRep3, so we SalesRep2 should not be able to update. EXEC UpdateLead 7, 'TmpWorld', '2001/12/10', 'Jim Lambert', 'jiml@tmpworld.com', '2433966', NULL, '2001/12/10' --Should be able to update, since SalesRep2 owns Lead with id 4 EXEC UpdateLead 4, 'HPS Inc.', '2001/12/10', 'Vikas Paul', 'vpaul@hps.com', '4533966', 'Can''t really trust -- Things are moving', '2001/12/10'