/*****************************************************************************
*   Presentation: Module 13 - Extended Events 
*   FileName:  Demo 1c - SQLskills_RecompilingProcedures_Workload.sql
*
*   Summary: Generates a workload using the AnnualTop5SalesPersonByMonthlyPercent
*			 procedure to demonstrate recompiling from DDL/DML mixing.
*
*   Date: March 14, 2011 
*
*   SQL Server Versions:
*         2008, 2008 R2
*         
******************************************************************************
*   Copyright (C) 2011 Jonathan M. Kehayias, SQLskills.com
*   All rights reserved. 
*
*   For more scripts and sample code, check out 
*      http://sqlskills.com/blogs/jonathan
*
*   You may alter this code for your own *non-commercial* purposes. You may
*   republish altered code as long as you include this copyright and give 
*	due credit. 
*
*
*   THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF 
*   ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED 
*   TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
*   PARTICULAR PURPOSE. 
*
******************************************************************************/

EXECUTE [AdventureWorks2008R2].[dbo].[AnnualTop5SalesPersonByMonthlyPercent] @Year=2005
GO
EXECUTE [AdventureWorks2008R2].[dbo].[AnnualTop5SalesPersonByMonthlyPercent] @Year=2006
GO
EXECUTE [AdventureWorks2008R2].[dbo].[AnnualTop5SalesPersonByMonthlyPercent] @Year=2007
GO
EXECUTE [AdventureWorks2008R2].[dbo].[AnnualTop5SalesPersonByMonthlyPercent] @Year=2008

GO
DECLARE @ManagerID int
SELECT TOP 1 @ManagerID = ManagerID 
FROM AdventureWorks.HumanResources.Employee
ORDER BY NEWID()

EXECUTE AdventureWorks.dbo.uspGetManagerEmployees @ManagerID
EXECUTE AdventureWorks2008R2.dbo.uspGetManagerEmployees @ManagerID
EXECUTE AdventureWorks2008R2.dbo.uspGetEmployeeManagers @ManagerID
EXECUTE AdventureWorks.dbo.uspGetEmployeeManagers @ManagerID
