/*====== S A L E S R E P 1 ======*/ --Inserting new data DECLARE @OrganizationID int EXEC InsertNewLead @OrganizationID out, 'Aditi', '2001/12/12', 'Vivek Chopra', 'vivek@aditi.com', '3312966', 'Looks promising', '2001/12/12' SELECT @OrganizationID AS OrganizationID GO DECLARE @OrganizationID int EXEC InsertNewLead @OrganizationID out, 'Talisma', '2001/12/12', 'Pradeep Singh', 'pradeep@talisma.com', '3312967', 'Terrific lead', '2001/12/12' SELECT @OrganizationID AS OrganizationID GO DECLARE @OrganizationID int EXEC InsertNewLead @OrganizationID out, 'Digital', '2001/12/13', 'Som Mittal', 'som@digital.com', '2447501', 'Very process oriented', '2001/12/13' SELECT @OrganizationID AS OrganizationID GO --Viewing data EXEC ShowMyLeads GO EXEC DeleteLead 5 --Lead with ID 5 is inserted by SalesRep2, so we SalesRep1 should not be able to delete. EXEC DeleteLead 3 --Should be able to delete, since SalesRep1 owns Lead with id 3 GO --Lead with ID 4 is inserted by SalesRep2, so we SalesRep1 should not be able to update. EXEC UpdateLead 4, 'HPS Inc.', '2001/12/10', 'Vikas Paul', 'vpaul@hps.com', '4533966', 'Can''t really trust', '2001/12/10' --Should be able to update, since SalesRep1 owns Lead with id 1 EXEC UpdateLead 1, 'Aditi', '2001/12/12', 'Vivek Chopra', 'vivek@aditi.com', '3312966', 'Looks promising, scheduled a meeting on 16th', '2001/12/14'