DonatShell
Server IP : 180.180.241.3  /  Your IP : 216.73.216.252
Web Server : Microsoft-IIS/7.5
System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
User : IUSR ( 0)
PHP Version : 5.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Program Files (x86)/Microsoft SQL Server/110/Tools/Binn/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /Program Files (x86)/Microsoft SQL Server/110/Tools/Binn/DTACLIENT.DLL
MZ@	!L!This program cannot be run in DOS mode.

$PEL5O!.^L `70 e@LS`8X<tK  H.textd, . `.rsrc`0@@.reloc6@B@LH8<	@*P j:Ds^ՀpV8pca
 !]_c=b{@Au7(Ғw=[Tf	g`f_sX6bA+LX'T;ֺ;C(
}}}}*{*{*{*"}*{*{*"}*&(
*0K,rpo
(3
rpo
+r-po
(o
o
,o
*0s
(
*(
*:(
}*{*j{-s}{*R{,s}*>(
}*0s

o 
*0o!

2
o"
t**6o"
t*~$
}(%
}{o&
t}
*~$
}(%
}}
*{	--( (#(,(*(.}}	**{	,(-{
o'
{
*2{o(
*(-{
o'
(8(&*j(,{
o)
(;*>{
o*
*:(>(*{*{
*0,(s+

o,
o-
}o.
}
*{*Z{6o/
(*0
(/:r7p(s0
{o1
o2
o3
`

,o
YE(+1}+(}+}+(s4
z(s4
zrp(s0
{o1
o2
o3
`
	,(sz
,o
*;
-
2{o5
*2{o6
*2{o7
*2{o8
*{*"}*0W((:K(s+

o9
o,
o-
	/-(s4
zrpo,
o-
	/rp+rp(:
o;
`
	>-(s4
zs<
(=
o>
o?
\o@
XoA
rp(B
oC
oD
(',,(hrp

($
(E
oF
+>(hrp($(%(&(E
oF
(G
oH
oI
9	(J
r>poK


,!
oL
/
(M
oI
3		-nYE,+6(s+((s+(s+(s-o;
`
	0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o.
o2
{o/
&*"(*{o!
o-
{o.
o2
{oa
}*0{
}*(
*{*{*{*{*{*{*{*{*0
8o
oM
o
(
o
%9~<-as
%rEp(
%rFp(
%r%Fp(
%rUFp(
%rkFp(
%rFp(
%rFp(
<~<(
9%	E-U}8}rpo
(
9}8}rpo
(
9}8}rpo
(
9}8}rpo
(
,m}+d}rpo
(
,K}+B}rpo
(
,)}+ }rpo
(
,}X
o
oO
?$*0(9rEp(-rp+rpo
rFp(-rp+rpo
r%Fp(-rp+rpo
rUFp(-rp+rpo
rkFp(-rp+rpo
rFp(-rp+rpo
rFp(-rp+rpo
*0(9|(hrFp
(-rFp+rGp(E
o
&(hr	Gp(-rFp+rGp(E
o
&(hr/Gp(-rFp+rGp(E
o
&(hroGp
	(-rFp+rGp	(E
o
&(hrGp(-rFp+rGp(E
o
&(hrGp(-rFp+rGp(E
o
&(hrGp(-rFp+rGp(E
o
&*r!Hp*&lSystem.Resources.ResourceReader, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089#System.Resources.RuntimeResourceSet=PADPADPNp鄑vB1|?/Jfn폽
&Ip}&:Y}71fkjg{7E2Wx5JzGD<gɤ3Ĥ

S<@ Or!#J(&(c++8.t.T07	8l<R=@4DGKd5TLgX9X39hڏk~LslvmnG1r
tvd
j3

	m;	Z	3c
IiVrx66{R
R$		(*&u2


#	'	.ArgCannotInterpretValueArgDuplicated2ArgMissingValuesArgUnexpectedArgUnknown:CannotConnectInSingleUserMode.CannotConnectToSqlAzure=2CannotConnectToSqlExpressyhCannotGenerateAddScriptForUnrecognizedRecommendation\CannotGenerateAddScriptRecommendationsForIndextCannotGenerateAddScriptRecommendationsForPartitionFunctionmpCannotGenerateAddScriptRecommendationsForPartitionSchemedCannotGenerateAddScriptRecommendationsForStatisticUZCannotGenerateAddScriptRecommendationsForViewjCannotGenerateDropScriptForUnrecognizedRecommendation?^CannotGenerateDropScriptRecommendationsForIndex~vCannotGenerateDropScriptRecommendationsForPartitionFunctionrCannotGenerateDropScriptRecommendationsForPartitionSchemejfCannotGenerateDropScriptRecommendationsForStatistic\CannotGenerateDropScriptRecommendationsForView\\CannotGenerateScriptRecommendationsForDatabaseVCannotGenerateScriptRecommendationsForTable(TCannotGenerateScriptRecommendationsForView:CannotParseFullyQualifiedName<CannotParseSchemaQualifiedName:CannotSelectObjectForInputConfigurationUnlessItHasValidRecommendationvxCannotSelectObjectForScriptingUnlessItHasValidRecommendation*DuplicateJobNameFound	EmptyWorkload^	,ErrorInProgressMonitor	(ErrorInStatusMonitor	@ExitCodeCommunicationLinkFailureF
0ExitCodePermissionDenied
,ExitCodeTimeoutExpired
.ExitCodeUnableToConnect
NFailedToInitializeMsdbDatabaseForTuning,:InvalidConfigurationXmlAtNodemlInvalidConfigurationXmlDatabaseWasNotSelectedForTuningFInvalidConfigurationXmlNodeNotFound:InvalidConfigurationXmlSchema+PInvalidConfigurationXmlTableDoesNotExistofInvalidConfigurationXmlTableWasNotSelectedForTuningjInvalidConfigurationXmlUnexpectedIndexColumnAttribute+
TInvalidConfigurationXmlUnexpectedNodeFound~
 InvalidSessionID
"InvalidSessionXml
:InvalidSessionXmlNodeNotFound
.InvalidSessionXmlSchema'HInvalidSessionXmlUnexpectedNodeFounde$LoginIsNotSysAdminFMaximumStorageSizeNeedsToBePositive>NonSysAdminCannotInitializeMsdb'BNotSupportedPartitionFunctionType.NumberOfEventsIsInvalid"JNumberOfIndexColumnsIsOutsideTheRangeKPNumberOfKeyIndexColumnsIsOutsideTheRangeDProjectedRowsMustBeGreaterThanZeroZPropertyIsUnavailableWhenRunningInConsoleMode:RecommendationAlreadyProvidedY<TunigProcessExitedUnexpectedly2TuningTimeHasToBePositive0Value '{0}' for option '{1}' cannot be accepted.?Option '{0}' was specified twice. Please remove one occurrence."Option '{0}' is missing its value.Unexpected value '{0}' found. Unrecognized option '{0}' found.cDatabase Engine Tuning Advisor does not support connecting to a server running in single-user mode.:Database Engine Tuning Advisor does not support SQL Azure.<Database Engine Tuning Advisor does not support SQL Express.?-- Unrecognized create recommendation '{0}' cannot be scripted.s-- Add script recommendations for index '{0}' on object {1} were not generated. Index already exists on the server.s-- Add script recommendations for partition function '{0}' were not generated. Object already exists on the server.q-- Add script recommendations for partition scheme '{0}' were not generated. Object already exists on the server.{-- Add script recommendations for statistic '{0}' on object {1} were not generated. Statistic already exists on the server.k-- Add script recommendations for indexed view {0} were not generated. Object already exists on the server.=-- Unrecognized drop recommendation '{0}' cannot be scripted.t-- Drop script recommendations for index '{0}' on object {1} were not generated. Index does not exist on the server.t-- Drop script recommendations for partition function '{0}' were not generated. Object does not exist on the server.r-- Drop script recommendations for partition scheme '{0}' were not generated. Object does not exist on the server.|-- Drop script recommendations for statistic '{0}' on object {1} were not generated. Statistic does not exist on the server.l-- Drop script recommendations for indexed view {0} were not generated. Object does not exist on the server.\-- Script recommendations for database '{0}' were not generated. Database is not accessible.`-- Script recommendations for table {0} were not generated. Object does not exist on the server.g-- Script recommendations for indexed view {0} were not generated. Object does not exist on the server.ECannot extract database, schema, and object name from a value: '{0}'.:Cannot extract schema and object name from a value: '{0}'.OCannot select object for input configuration unless it has valid recommendationECannot select object for scripting unless it has valid recommendationNCannot perform scheduling operation: job '{0}' already exists in the database.PBefore starting a tuning session one needs to specify a workload file or a tableJUnexpected error in the Progress Monitor thread. Shutting down the thread.HUnexpected error in the Status Monitor thread. Shutting down the thread.GCommunication link to the server failed before processing was complete.1User was not authorized to connect to the server.7Time out expired while trying to connect to the server./Failed to establish a connection to the server.?Failed to initialize MSDB database for tuning (exit code: {0}).0Configuration XML section is invalid at {0} nodePConfiguration XML section is invalid. Database '{0}' was not selected for tuning8Configuration XML section is invalid. Node {0} not foundBConfiguration XML section is invalid. Schema validation error: {0}_Configuration XML section is invalid. User table [{0}].[{1}].[{2}] does not exist on the serverYConfiguration XML section is invalid. Table [{0}].[{1}].[{2}] was not selected for tuningQConfiguration XML section is invalid. Found unexpected index column attribute {0}?Configuration XML section is invalid. Found unexpected node {0}Invalid session idSession XML section is invalid2Session XML section is invalid. Node {0} not found<Session XML section is invalid. Schema validation error: {0}9Session XML section is invalid. Found unexpected node {0}PIn order to perform tuning you have to be a member of sysadmin fixed server role3Maximum storage size needs to have a positive valueIn order to start tuning application needs to create some objects in MSDB database. You have to be a member of sysadmin fixed server role in order to initialize MSDB for tuningFType '{0}' cannot be used as an argument type of a partition function.'Number of events {0} has to be positiveENumber of index columns to consider is outside the range (1-{1}): {0}INumber of key index columns to consider is outside the range (1-{1}): {0}?Number of projected rows must be greater than or equal to zero.9Property {0} is unavailable when running in console mode.Recommendation for data structure '{0}' has been already added. There can be only one recommendation per physical data structure.#Tuning process exited unexpectedly.-Tuning time ({0}) has to be a positive numberlSystem.Resources.ResourceReader, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089#System.Resources.RuntimeResourceSet$PADPADPNaʩ bc3
Q
ōPȓ="yA0Sc(sY 

Q@bŽHa*3,Fv03DD7/HJKY	LXyN.`eFg؂|eB1ULqr(:/cAbortedAborting	8ApplyingCreateRecommendation:ApplyingCreateRecommendation2?4ApplyingDropRecommendationv6ApplyingDropRecommendation2CollationCreationTime DefaultValueNameDesktopDeveloperEditionEnterprise Finished,Finishing6GeneralCategoryAIDJJobCategoryNJobSchedulegJobStepTitlexJobTitleMajorVersionMinorVersionNamePersonal
ReadyRunningScheduledStandardStatusStatusCategory$SwitchingDbContextUnknownB
UsageKUserNameTVersion_AbortedAborting*Applying 'create' recommendation on '{0}'.5Applying 'create' recommendation on '{0}' from '{1}'.(Applying 'drop' recommendation on '{0}'.2Applying 'drop' recommendation on '{0} from '{1}'.Server Collation
Creation timevalueDesktop	DeveloperServer Edition
EnterpriseFinished	FinishingGeneralID[Uncategorized (Local)]Tuning schedule!Running recommendations DDL - {0}Apply tuning recommendations
Major Version
Minor VersionNamePersonalReadyRunning	ScheduledStandardStatusStatus$Switching database context to '{0}'.UnknownUsage: 	User NameVersion[/***************************************************************/
/* Make sure we are int the right database                     */
/***************************************************************/
use msdb
go

/**************************************************************/
/* DTA_input                                                   */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_input')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_input
   (
   SessionName nvarchar(30) not null,
   SessionID int identity primary key,
   TuningOptions ntext not null,
   CreationTime datetime not null default GetDate(),
   ScheduledStartTime datetime not null default GetDate(),
   ScheduledJobName sysname not null default '',
   InteractiveStatus tinyint not null default 0,
   TuningOwner nvarchar(256) not null default '',
   LogTableName nvarchar(128) not null default '',
   GlobalSessionID uniqueidentifier default  NEWID()
   )
END
go

/**************************************************************/
/* DTA_progress                                                */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_progress')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_progress
   (
   ProgressEventID int identity primary key,
   SessionID int references DTA_input(SessionID) on delete cascade,
   TuningStage tinyint not null default 0,
   WorkloadConsumption tinyint not null check (WorkloadConsumption>=0 and WorkloadConsumption<=100),
   EstImprovement int not null default 0,
   ProgressEventTime datetime not null default GetDate()
   )

   CREATE INDEX DTA_progress_index on DTA_progress(SessionID)
END
go

/**************************************************************/
/* DTA_output                                                  */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_output')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_output
   (
   SessionID int not null primary key references DTA_input(SessionID) on delete cascade,
   TuningResults ntext not null,
   StopTime datetime not null default GetDate(),
   FinishStatus tinyint not null default 0
   )

   CREATE INDEX DTA_output_index on DTA_output(SessionID)
END
go

/**************************************************************/
/* DTA_tuninglog                                              */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_tuninglog')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_tuninglog
   (
   SessionID int not null references DTA_input(SessionID) on delete cascade,
   RowID int not null,
   CategoryID char(4) not null,
   Event ntext null,
   Statement ntext null,
   Frequency int not null,
   Reason ntext null,
   CONSTRAINT DTA_tuninglog_check1 CHECK (Frequency >= 1)
   )
   
   CREATE INDEX DTA_tuninglog_index on DTA_tuninglog (SessionID, RowID)
END
go


/**************************************************************/
/* DTA_reports_database                                        */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_database')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_database
   (
   DatabaseID int identity primary key,
   SessionID int not null references DTA_input(SessionID) on delete cascade, 
   DatabaseName sysname not null
   )

   CREATE INDEX DTA_reports_database_index on DTA_reports_database(SessionID)
END
go

/**************************************************************/
/* DTA_reports_partitionfunction                               */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_partitionfunction')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_partitionfunction
   (
   PartitionFunctionID int identity primary key, 
   DatabaseID int not null references DTA_reports_database(DatabaseID) on delete cascade, 
   PartitionFunctionName sysname not null,
   PartitionFunctionDefinition ntext not null
   )

   CREATE INDEX DTA_reports_partitionfunction_index on DTA_reports_partitionfunction(DatabaseID)
END
go

/**************************************************************/
/* DTA_reports_partitionscheme                                 */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_partitionscheme')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_partitionscheme
   (
   PartitionSchemeID int identity primary key,
   PartitionFunctionID int not null references DTA_reports_partitionfunction(PartitionFunctionID) on delete cascade,
   PartitionSchemeName sysname not null,
   PartitionSchemeDefinition ntext not null
   )

   CREATE INDEX DTA_reports_partitionscheme_index on DTA_reports_partitionscheme(PartitionFunctionID)
END
go

/**************************************************************/
/* DTA_reports_table                                           */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_table')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_table
   (
   TableID int identity primary key, 
   DatabaseID int not null references DTA_reports_database(DatabaseID) on delete cascade, 
   SchemaName sysname not null,
   TableName sysname not null,
   IsView bit not null default 0,
   ViewDefinition ntext
   )

   CREATE INDEX DTA_reports_table_index on DTA_reports_table(DatabaseID)
END
go

/**************************************************************/
/* DTA_reports_tableview                                       */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_tableview')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_tableview
   (
   TableID int not null references DTA_reports_table(TableID) on delete cascade,
   ViewID int not null references DTA_reports_table(TableID)
   )

   CREATE CLUSTERED INDEX DTA_reports_tableview_index on DTA_reports_tableview(TableID)

   CREATE INDEX DTA_reports_tableview_index2 on DTA_reports_tableview(ViewID)
END
go

/**************************************************************/
/* DTA_reports_query                                           */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_query')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_query
   (
   QueryID int not null,
   SessionID int not null references DTA_input(SessionID) on delete cascade, 
   StatementType smallint not null, 
   StatementString ntext not null,
   CurrentCost float not null, 
   RecommendedCost float not null,  
   Weight float not null, 
   EventString ntext,
   EventWeight float not null
   )

   ALTER TABLE DTA_reports_query ADD CONSTRAINT DTA_reports_query_pk PRIMARY KEY (QueryID, SessionID)
END
go

/**************************************************************/
/* DTA_reports_querytable                                      */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_querytable')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_querytable
   (
   QueryID int not null,
   SessionID int not null,
   TableID int not null references DTA_reports_table(TableID)
   )
   ALTER TABLE DTA_reports_querytable ADD CONSTRAINT DTA_reports_querytable_fk FOREIGN KEY (QueryID,SessionID) REFERENCES DTA_reports_query(QueryID,SessionID) on DELETE CASCADE

   CREATE CLUSTERED INDEX DTA_reports_querytable_index on DTA_reports_querytable(QueryID,SessionID)

   CREATE INDEX DTA_reports_querytable_index2 on DTA_reports_querytable(TableID)
END
go
/**************************************************************/
/* DTA_reports_querydatabase                                      */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_querydatabase')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_querydatabase
   (
   QueryID int not null,
   SessionID int not null,
   DatabaseID int not null references DTA_reports_database(DatabaseID)
   )
   ALTER TABLE DTA_reports_querydatabase ADD CONSTRAINT DTA_reports_querydatabase_fk FOREIGN KEY (QueryID,SessionID) REFERENCES DTA_reports_query(QueryID,SessionID) on DELETE CASCADE

   CREATE CLUSTERED INDEX DTA_reports_querydatabase_index on DTA_reports_querydatabase(QueryID,SessionID)

   CREATE INDEX DTA_reports_querydatabase_index2 on DTA_reports_querydatabase(DatabaseID)
END
go
/**************************************************************/
/* DTA_reports_index                                           */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_index')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_index
   (
   IndexID int identity primary key,
   TableID int not null references DTA_reports_table(TableID) on delete cascade, 
   IndexName sysname not null,
   IsClustered  bit not null default 0, 
   IsUnique bit not null default 0,
   IsMerged bit not null default 0,
   IsHeap   bit not null default 1,
   IsExisting bit not null default 1, 
   Storage int not null,
   NumRows int not null,
   FractionUsedCurrent float ,
   FractionUsedRecommended float ,
   PartitionSchemeID int 
   )

   CREATE INDEX DTA_reports_indexindex on DTA_reports_index(TableID)

   CREATE INDEX DTA_reports_indexindex2 on DTA_reports_index(PartitionSchemeID)
END
go

/**************************************************************/
/* DTA_reports_queryindex                                      */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_queryindex')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_queryindex
   (
   QueryID int not null, 
   SessionID int not null,
   IndexID int not null references DTA_reports_index(IndexID),
   IsRecommendedConfiguration bit not null 
   )
   ALTER TABLE DTA_reports_queryindex ADD CONSTRAINT DTA_reports_queryindex_fk FOREIGN KEY (QueryID,SessionID) REFERENCES DTA_reports_query(QueryID,SessionID) on DELETE CASCADE

   CREATE CLUSTERED INDEX DTA_reports_queryindex_index on DTA_reports_queryindex(QueryID,SessionID)

   CREATE INDEX DTA_reports_queryindex_index2 on DTA_reports_queryindex(IndexID)
END
go

/**************************************************************/
/* DTA_reports_column                                          */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_column')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_column
   (
   ColumnID int identity primary key,
   TableID int not null references DTA_reports_table(TableID) on delete cascade, 
   ColumnName sysname not null
   )

   CREATE INDEX DTA_reports_column_index on DTA_reports_column(TableID)
END
go

/**************************************************************/
/* DTA_reports_indexcolumn                                      */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_indexcolumn')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_indexcolumn
   (
   IndexID int not null references DTA_reports_index(IndexID) on delete cascade,
   ColumnID int not null,
   ColumnOrder int,
   PartitionColumnOrder int not null default 0,
   IsKeyColumn bit not null default 1,
   IsDescendingColumn bit not null default 1 
   )

   CREATE CLUSTERED INDEX DTA_reports_indexcolumn_index on DTA_reports_indexcolumn(IndexID)

   CREATE INDEX DTA_reports_indexcolumn_index2 on DTA_reports_indexcolumn(ColumnID)
   END
go

/**************************************************************/
/* DTA_reports_querycolumn                                     */
/*                                                            */
/**************************************************************/
IF (NOT EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'DTA_reports_querycolumn')
                  AND (type = 'U')
                  AND (uid = USER_ID('dbo'))))
BEGIN
   CREATE TABLE dbo.DTA_reports_querycolumn
   (
   QueryID int not null, 
   SessionID int not null,
   ColumnID int not null references DTA_reports_column(ColumnID)
    )
   ALTER TABLE DTA_reports_querycolumn ADD CONSTRAINT DTA_reports_querycolumn_fk FOREIGN KEY (QueryID,SessionID) REFERENCES DTA_reports_query(QueryID,SessionID) on DELETE CASCADE

   CREATE CLUSTERED INDEX DTA_reports_querycolumn_index on DTA_reports_querycolumn(QueryID,SessionID)

   CREATE INDEX DTA_reports_querycolumn_index2 on DTA_reports_querycolumn(ColumnID)
END
go


/*******************************/
/***Stored Procs for DTA********/
/******************************/


/*
	sp_DTA_add_session 
		@SessionName, 	- name of the session nvarchar[30]
		@TuningOptions, 	- input xml
		@SessionID OUTPUT  return value, id of the new session.
*/
IF  EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_add_session' AND type = 'P')
   DROP PROCEDURE sp_DTA_add_session 
go
CREATE PROCEDURE sp_DTA_add_session 
   @SessionName nvarchar(30), 
   @TuningOptions ntext,
   @SessionID int OUTPUT
AS 
	DECLARE @UserName as nvarchar(256) 
	DECLARE	@x_SessionName nvarchar(30)
	DECLARE @ErrorString nvarchar(500)


SET NOCOUNT ON
BEGIN TRANSACTION 
	SELECT @x_SessionName = @SessionName
	FROM msdb.dbo.DTA_input
	WHERE SessionName = @SessionName

	IF (@x_SessionName IS NOT NULL)
		BEGIN
			ROLLBACK TRANSACTION
			SET @ErrorString = 'The session ' + '"' + LTRIM(RTRIM(@SessionName)) + '"' +' already exists. Please use a different session name.'
			RAISERROR ( @ErrorString, 16, 1)
			RETURN(1)
		END				
	insert into msdb.dbo.DTA_input (SessionName,TuningOptions,TuningOwner) 
	values (@SessionName,@TuningOptions,SUSER_SNAME()) 

	
	IF @@ERROR <> 0
		BEGIN
			ROLLBACK TRANSACTION
			RAISERROR ('Inserting to dta input table failed', 16, 1)
			RETURN @@ERROR
		END				
	SELECT @SessionID = @@identity	

	insert into [msdb].[dbo].[DTA_progress]
	(SessionID,WorkloadConsumption,EstImprovement,TuningStage)
	 values(@SessionID,0,0,0)

	IF @@ERROR <> 0
		BEGIN
			ROLLBACK TRANSACTION
			RAISERROR ('Inserting to dta progress table failed', 16, 1)
			RETURN @@ERROR
		END				
	
COMMIT TRANSACTION
	RETURN 0
go
GRANT EXEC ON sp_DTA_add_session TO PUBLIC
go
/*
	sp_DTA_check_permission
		@SessionID,		- ID of a session to check
		Checks if caller has enough permissions
		If caller in SA role then returns 0 (allow)
		If caller in DB role and if caller owns session then returns 0 (allow)
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_check_permission' AND type = 'P')
   DROP PROCEDURE sp_DTA_check_permission 
go
CREATE PROCEDURE sp_DTA_check_permission 
				@SessionID int
AS 
BEGIN
	DECLARE @tuning_owner nvarchar(128)
	DECLARE @user_name nvarchar(128)
	SET NOCOUNT ON

	IF (ISNULL(IS_SRVROLEMEMBER(N'sysadmin'), 0) = 1)
	BEGIN
		RETURN(0) 
	END
	
	SELECT @tuning_owner = TuningOwner 
	FROM msdb.dbo.DTA_input
	WHERE  SessionID = @SessionID
	
	SELECT @user_name = SUSER_NAME()
		
	IF(@tuning_owner =@user_name)
		RETURN(0)
	ELSE
		RETURN(1)
							
	RETURN(1)
END		
go
GRANT EXEC ON sp_DTA_check_permission TO PUBLIC
go
/*
	sp_DTA_delete_session
			@SessionID		- ID of a session to delete
			
	Deletes a session with a given ID and removes references to that session FROM all tables. 
*/
				
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_delete_session' AND type = 'P')
   DROP PROCEDURE sp_DTA_delete_session 
go

CREATE PROCEDURE sp_DTA_delete_session 
	@SessionID int 
AS 
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	delete FROM msdb.dbo.DTA_input WHERE SessionID=@SessionID
END
go
GRANT EXEC ON sp_DTA_delete_session TO PUBLIC
go
/*
	sp_DTA_get_session_tuning_results
			@SessionID			- ID of a session requested

	Returns the following rowset:
	TuningResults, FinishStatus, StopTime 
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_session_tuning_results' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_session_tuning_results 
go
CREATE PROCEDURE sp_DTA_get_session_tuning_results 
	@SessionID int 
AS 
BEGIN
	SET NOCOUNT ON
	DECLARE @retval  int							
	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	SELECT	FinishStatus,TuningResults 
	FROM	msdb.dbo.DTA_output 
	WHERE	SessionID=@SessionID
END	
go
GRANT EXEC ON sp_DTA_get_session_tuning_results TO PUBLIC
go
/* sp_DTA_set_interactivestatus
	@InterActiveStatus - Interactive status in MSDB
	@SessionID	- ID of a session requested
	Sets the interactive status in input table
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_set_interactivestatus' AND type = 'P')
   DROP PROCEDURE sp_DTA_set_interactivestatus
go
CREATE PROCEDURE sp_DTA_set_interactivestatus
	@InterActiveStatus int,
	@SessionID int 

AS 
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	update [msdb].[dbo].[DTA_input] set InteractiveStatus = @InterActiveStatus WHERE SessionID = @SessionID

END	
go
GRANT EXEC ON sp_DTA_set_interactivestatus TO PUBLIC
go
/*
	sp_DTA_help_session
		@SessionID				-	ID of a session to list, optional
		@IncludeTuningOptions	-	Flag that indicates that input XML
									Should be included in returned rowset.
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_help_session' AND type = 'P')
   DROP PROCEDURE sp_DTA_help_session 
go

CREATE PROCEDURE sp_DTA_help_session 
	@SessionID int = 0,
	@IncludeTuningOptions int = 0
AS 
BEGIN
	DECLARE @tuning_owner nvarchar(256)
	DECLARE @retval  int
	DECLARE @InteractiveStatus tinyint
	DECLARE @delta int

	SET NOCOUNT ON

	-- List all Sessions mode
	IF @SessionID = 0
	BEGIN
		-- If sysadmin role then rowset has all the rows in the table
		IF (ISNULL(IS_SRVROLEMEMBER(N'sysadmin'), 0) = 1)
		BEGIN
		
			IF (@IncludeTuningOptions = 0) 
			BEGIN
				SELECT	I.SessionID, I.SessionName, I.InteractiveStatus,
						I.CreationTime, I.ScheduledStartTime, O.StopTime,I.GlobalSessionID
						FROM msdb.dbo.DTA_input I left outer join msdb.dbo.DTA_output  O
						on I.SessionID = O.SessionID	
				order by
						I.SessionID	DESC					
			END
			
			ELSE IF (@IncludeTuningOptions = 1)
			BEGIN
				SELECT	I.SessionID, I.SessionName, I.InteractiveStatus,
						I.CreationTime, I.ScheduledStartTime, O.StopTime,I.TuningOptions,I.GlobalSessionID
						FROM msdb.dbo.DTA_input  I left outer join msdb.dbo.DTA_output as O
						on I.SessionID = O.SessionID
				order by
						I.SessionID	DESC
			END									
	
		END
		
		ELSE 
		BEGIN
			IF ( @IncludeTuningOptions = 0 )
			BEGIN
				SELECT	I.SessionID, I.SessionName, I.InteractiveStatus,
						I.CreationTime, I.ScheduledStartTime, O.StopTime,I.GlobalSessionID
						FROM msdb.dbo.DTA_input I left outer join msdb.dbo.DTA_output  O
						on  I.SessionID = O.SessionID
						WHERE TuningOwner = SUSER_NAME()
						
				order by
						I.SessionID	DESC					
			END
			
			ELSE IF (@IncludeTuningOptions = 1)
			BEGIN
				SELECT	I.SessionID, I.SessionName, I.InteractiveStatus,
						I.CreationTime, I.ScheduledStartTime, O.StopTime,I.TuningOptions,I.GlobalSessionID
						FROM msdb.dbo.DTA_input I left outer join msdb.dbo.DTA_output O
						on  I.SessionID = O.SessionID
						WHERE
						TuningOwner = SUSER_NAME()
						
				order by
						I.SessionID	DESC					
										
			END
		END
	END

	ELSE
	BEGIN
		EXEC @retval =  sp_DTA_check_permission @SessionID
		IF @retval = 1
		BEGIN
			RAISERROR ('Not the owner of this session', 16, 1)
			RETURN(1)
		END	
	
		IF ( @IncludeTuningOptions = 0) 
		BEGIN
			SELECT	I.SessionID, I.SessionName, I.InteractiveStatus,
					I.CreationTime, I.ScheduledStartTime, O.StopTime,I.GlobalSessionID
			FROM msdb.dbo.DTA_input I left outer join msdb.dbo.DTA_output O
			on  I.SessionID = O.SessionID
			WHERE I.SessionID = @SessionID	
		END
		ELSE IF (@IncludeTuningOptions = 1)
		BEGIN
			SELECT	I.SessionID, I.SessionName, I.InteractiveStatus,
					I.CreationTime, I.ScheduledStartTime, O.StopTime,I.TuningOptions,I.GlobalSessionID
			FROM msdb.dbo.DTA_input I left outer join msdb.dbo.DTA_output O
			on  I.SessionID = O.SessionID
			WHERE	I.SessionID = @SessionID				
		END
	
		SELECT	ProgressEventID,TuningStage,WorkloadConsumption,EstImprovement,
				ProgressEventTime 
		FROM	msdb.dbo.DTA_progress 
		WHERE	SessionID=@SessionID
		order by ProgressEventID
				

		SELECT	 @InteractiveStatus=InteractiveStatus
		FROM msdb.dbo.DTA_input
		WHERE SessionID = @SessionID	

		SELECT @delta=DATEDIFF(minute ,ProgressEventTime,getdate())
		FROM msdb.dbo.DTA_progress 
		WHERE  SessionID =@SessionID
		IF (@InteractiveStatus IS NOT NULL AND( @InteractiveStatus <> 4 AND  @InteractiveStatus <> 6) AND @delta > 5)
		BEGIN
			update [msdb].[dbo].[DTA_input] set InteractiveStatus = 6
			WHERE SessionID = @SessionID
		END

		
	END
END								
go
GRANT EXEC ON sp_DTA_help_session TO PUBLIC
go
/*
	sp_dta_update_session
		@SessionID,		- ID of a session to update
		[@SessionName,]	- New session name (optional)
		[@Status]		- New session status (optional)
			Possible values:
			0  stop session
			1  cancel session
			2  start session (currently not used, reserved)
	At least one of the optional parameters must be provided.
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_update_session' AND type = 'P')
   DROP PROCEDURE sp_DTA_update_session 
go
CREATE PROCEDURE sp_DTA_update_session 
	@SessionID int, 
	@SessionName nvarchar(30) = NULL, 
	@InteractiveStatus tinyint = NULL
AS 
BEGIN  
	DECLARE	@x_SessionName nvarchar(30)
	DECLARE @x_InteractiveStatus tinyint
	DECLARE @retval  int
	DECLARE @ErrorString nvarchar(500)


	SET NOCOUNT ON
	SELECT @SessionName = LTRIM(RTRIM(@SessionName))
	
	
	DECLARE	@dup_SessionName nvarchar(30)

	IF @SessionName IS NOT NULL
	BEGIN
		SELECT @dup_SessionName = @SessionName
		FROM msdb.dbo.DTA_input
		WHERE SessionName = @SessionName
	
		IF (@dup_SessionName IS NOT NULL)
			BEGIN
				SET @ErrorString = 'The session ' + '"' + LTRIM(RTRIM(@SessionName)) + '"' +' already exists. Please use a different session name.'
				RAISERROR ( @ErrorString, 16, 1)
				RETURN(1)
			END				
	END
	
	exec @retval =  sp_DTA_check_permission @SessionID
	IF @retval = 1
	BEGIN
		 RAISERROR ('Not the owner of this session', 16, 1)
		 RETURN(1)
	END
	
	IF	((@SessionName IS NOT NULL) OR
		(@InteractiveStatus IS NOT NULL)
		)
	BEGIN
		SELECT	@x_SessionName = SessionName,
				@x_InteractiveStatus = InteractiveStatus
		FROM msdb.dbo.DTA_input
		WHERE SessionID = @SessionID

		IF (@SessionName IS NULL) SELECT @SessionName = @x_SessionName
		IF (@InteractiveStatus IS NULL) SELECT @InteractiveStatus = @x_InteractiveStatus

		UPDATE msdb.dbo.DTA_input
		SET SessionName = @SessionName,
			InteractiveStatus = @InteractiveStatus
		WHERE SessionID = @SessionID
	END		

END
go
GRANT EXEC ON sp_DTA_update_session TO PUBLIC
go	
/*
	sp_DTA_get_tuninglog
			@SessionID			- ID of a session requested

	Returns the following rowset:
	RowID,CategoryID,Event,Statement,Frequency,Reason 
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_tuninglog' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_tuninglog 
go
CREATE PROCEDURE sp_DTA_get_tuninglog 
	@SessionID int, 
	@XML int = 0

AS 
BEGIN
	SET NOCOUNT ON
	DECLARE @retval  int							
	DECLARE	@LogTableName nvarchar(128)
	DECLARE	@DefaultTableName nvarchar(128)
	DECLARE @SQLString nvarchar(500)


	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	
	set @DefaultTableName = '[msdb].[dbo].[DTA_tuninglog]'
	set @LogTableName = ' '
	SELECT top 1 @LogTableName = LogTableName FROM DTA_input WHERE SessionID = @SessionID			

	IF (@LogTableName = ' ')
		RETURN (0)


	IF @XML = 0
	BEGIN
	
		IF @LogTableName = 	@DefaultTableName
		BEGIN
			SELECT RowID,CategoryID,Event,Statement,Frequency,Reason FROM [msdb].[dbo].[DTA_tuninglog]
			WHERE SessionID = @SessionID
			RETURN(0)
		END		
		
		set @SQLString = N' SELECT RowID,CategoryID,Event,Statement,Frequency,Reason FROM '
		set @SQLString =  @SQLString + @LogTableName
		set @SQLString = @SQLString + N' WHERE SessionID = '
		set @SQLString = @SQLString + CONVERT(nvarchar(10),@SessionID)
		
		EXEC (@SQLString)
	END		
	
	ELSE
	BEGIN
		IF @LogTableName = 	@DefaultTableName
		BEGIN
			SELECT RowID,CategoryID,Event,Statement,Frequency,Reason FROM [msdb].[dbo].[DTA_tuninglog]
			WHERE SessionID = @SessionID
			FOR XML RAW
			RETURN(0)
		END		
		
		set @SQLString = N' SELECT RowID,CategoryID,Event,Statement,Frequency,Reason FROM '
		set @SQLString =  @SQLString + @LogTableName
		set @SQLString = @SQLString + N' WHERE SessionID = '
		set @SQLString = @SQLString + CONVERT(nvarchar(10),@SessionID)
		set @SQLString = @SQLString + 'FOR XML RAW'

		
		EXEC (@SQLString)

	END
END	
go
GRANT EXEC ON sp_DTA_get_tuninglog TO PUBLIC
go
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_indexusagehelper' AND type = 'P')
   DROP PROCEDURE sp_DTA_indexusagehelper 
go
CREATE PROCEDURE sp_DTA_indexusagehelper
	@SessionID		int,
	@IsRecommended	int,
	@XMLType		int
AS
BEGIN
	IF @XMLType = 0 
	BEGIN
		SELECT	D1.DatabaseName as 'Database Name',
				T1.SchemaName as 'Schema Name',
				T1.TableName as 'Table Name',
				I1.IndexName as 'Index Name',
				R.Count as 'Number of times index was referenced in workload' ,
				CAST(ROUND(R.Usage,2) as decimal(10,2)) as 'Percentage usage'
		FROM 
				DTA_reports_database as D1 ,
				DTA_reports_index as I1,
				DTA_reports_table as T1,
				(
					SELECT D.DatabaseID,T.TableID ,
							I.IndexID  ,SUM(Q.Weight) as Count,
							100.0 *  SUM(Q.Weight) / 
							( 1.0 * (	SELECT	CASE WHEN SUM(Q.Weight) > 0 THEN  SUM(Q.Weight)
												ELSE 1
												END	
									
										FROM [msdb].[dbo].[DTA_reports_query] AS Q, 
										DTA_reports_queryindex AS QI
										WHERE QI.QueryID = Q.QueryID
										AND Q.SessionID = QI.SessionID and
										QI.IsRecommendedConfiguration = @IsRecommended and
										Q.SessionID = @SessionID ))
				AS Usage
		FROM 
				[msdb].[dbo].[DTA_reports_index] AS I	
				LEFT OUTER JOIN
				[msdb].[dbo].[DTA_reports_queryindex] AS QI ON QI.IndexID = I.IndexID
				LEFT OUTER JOIN
				[msdb].[dbo].[DTA_reports_query] AS Q ON QI.QueryID = Q.QueryID
				JOIN
				[msdb].[dbo].[DTA_reports_table] as T ON I.TableID = T.TableID
				JOIN
				[msdb].[dbo].[DTA_reports_database] as D ON T.DatabaseID = D.DatabaseID
				AND Q.SessionID = QI.SessionID and 
				QI.IsRecommendedConfiguration = @IsRecommended and
				Q.SessionID = @SessionID
				
				GROUP BY I.IndexID,T.TableID,D.DatabaseID) as R
				WHERE R.DatabaseID = D1.DatabaseID and
				R.TableID = T1.TableID and
				R.IndexID = I1.IndexID and
				D1.SessionID = @SessionID  and
				R.Count > 0
				ORDER BY R.Count DESC
	END
	ELSE
	
	BEGIN
		SELECT	D1.DatabaseName as 'Database Name',
				T1.SchemaName as 'Schema Name',
				T1.TableName as 'Table Name',
				I1.IndexName as 'Index Name',
				R.Count as 'Number of times index was referenced in workload' ,
				CAST(ROUND(R.Usage,2) as decimal(10,2)) as 'Percentage usage'
		FROM 
				[msdb].[dbo].[DTA_reports_database] as D1 ,
				[msdb].[dbo].[DTA_reports_index] as I1,
				[msdb].[dbo].[DTA_reports_table] as T1,
				(
					SELECT D.DatabaseID,T.TableID ,
							I.IndexID  ,SUM(Q.Weight) as Count,
							100.0 *  SUM(Q.Weight) / 
							( 1.0 * (	SELECT	CASE WHEN SUM(Q.Weight) > 0 THEN  SUM(Q.Weight)
												ELSE 1
												END	
									
										FROM [msdb].[dbo].[DTA_reports_query] AS Q, 
										[msdb].[dbo].[DTA_reports_queryindex] AS QI
										WHERE QI.QueryID = Q.QueryID
										AND Q.SessionID = QI.SessionID and
										QI.IsRecommendedConfiguration = @IsRecommended and
										Q.SessionID = @SessionID ))
				AS Usage
		FROM 
				[msdb].[dbo].[DTA_reports_index] AS I	
				LEFT OUTER JOIN
				DTA_reports_queryindex AS QI ON QI.IndexID = I.IndexID
				LEFT OUTER JOIN
				DTA_reports_query AS Q ON QI.QueryID = Q.QueryID
				JOIN
				DTA_reports_table as T ON I.TableID = T.TableID
				JOIN
				DTA_reports_database as D ON T.DatabaseID = D.DatabaseID
				AND Q.SessionID = QI.SessionID and 
				QI.IsRecommendedConfiguration = @IsRecommended and
				Q.SessionID = @SessionID
				
				GROUP BY I.IndexID,T.TableID,D.DatabaseID) as R
				WHERE R.DatabaseID = D1.DatabaseID and
				R.TableID = T1.TableID and
				R.IndexID = I1.IndexID and
				D1.SessionID = @SessionID and
				R.Count > 0
				ORDER BY R.Count DESC
				FOR XML RAW
	END
				
END
go
GRANT EXEC ON sp_DTA_indexusagehelper TO PUBLIC
go
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_databaseaccesshelper' AND type = 'P')
   DROP PROCEDURE sp_DTA_databaseaccesshelper 
go
CREATE PROCEDURE sp_DTA_databaseaccesshelper
	@SessionID		int,
	@XMLType		int
AS
BEGIN
	IF @XMLType = 0
	BEGIN
		SELECT	D1.DatabaseName as 'Database Name',
				R.Count as 'Number of times database was referenced in workload' ,
				CAST(ROUND(R.Usage,2) as decimal(10,2)) as 'Percentage usage'
		FROM 
				[msdb].[dbo].[DTA_reports_database] as D1 ,
				(
					SELECT D.DatabaseID,SUM(Q.Weight) as Count,
							100.0 *  SUM(Q.Weight) / 
							( 1.0 * (	SELECT	CASE WHEN SUM(Q.Weight) > 0 THEN  SUM(Q.Weight)
												ELSE 1
												END	
									
										FROM [msdb].[dbo].[DTA_reports_query] AS Q, 
										[msdb].[dbo].[DTA_reports_querydatabase] AS QD
										WHERE QD.QueryID = Q.QueryID
										AND Q.SessionID = QD.SessionID and
										Q.SessionID = @SessionID ))
				AS Usage
		FROM 
					[msdb].[dbo].[DTA_reports_database] AS D
					LEFT OUTER JOIN
					[msdb].[dbo].[DTA_reports_querydatabase] AS QD ON QD.DatabaseID = D.DatabaseID
					LEFT OUTER JOIN
					DTA_reports_query AS Q ON QD.QueryID = Q.QueryID
					AND Q.SessionID = QD.SessionID and 
					Q.SessionID = @SessionID		
					GROUP BY D.DatabaseID
				) as R
				WHERE R.DatabaseID = D1.DatabaseID  and
				D1.SessionID = @SessionID and
				R.Count > 0
				ORDER BY R.Count DESC
		
	END
	ELSE
	BEGIN
		SELECT	D1.DatabaseName as 'Database Name',
				R.Count as 'Number of times database was referenced in workload' ,
				CAST(ROUND(R.Usage,2) as decimal(10,2)) as 'Percentage usage'
		FROM 
				[msdb].[dbo].[DTA_reports_database] as D1 ,
				(
					SELECT D.DatabaseID,SUM(Q.Weight) as Count,
							100.0 *  SUM(Q.Weight) / 
							( 1.0 * (	SELECT	CASE WHEN SUM(Q.Weight) > 0 THEN  SUM(Q.Weight)
												ELSE 1
												END	
									
										FROM [msdb].[dbo].[DTA_reports_query] AS Q, 
										[msdb].[dbo].[DTA_reports_querydatabase] AS QD
										WHERE QD.QueryID = Q.QueryID
										AND Q.SessionID = QD.SessionID and
										Q.SessionID = @SessionID ))
				AS Usage
		FROM 
					[msdb].[dbo].[DTA_reports_database] AS D
					LEFT OUTER JOIN
					DTA_reports_querydatabase AS QD ON QD.DatabaseID = D.DatabaseID
					LEFT OUTER JOIN
					DTA_reports_query AS Q ON QD.QueryID = Q.QueryID
					AND Q.SessionID = QD.SessionID and 
					Q.SessionID = @SessionID		
					GROUP BY D.DatabaseID
				) as R
				WHERE R.DatabaseID = D1.DatabaseID  and
				D1.SessionID = @SessionID  and
				R.Count > 0
				ORDER BY R.Count DESC
				FOR XML RAW
		
	END

	
END
go
GRANT EXEC ON sp_DTA_databaseaccesshelper TO PUBLIC
go
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_tableaccesshelper' AND type = 'P')
   DROP PROCEDURE sp_DTA_tableaccesshelper 
go
CREATE PROCEDURE sp_DTA_tableaccesshelper
	@SessionID		int,
	@XMLType		int
AS
BEGIN
	IF @XMLType = 0
	BEGIN
		SELECT	D1.DatabaseName as 'Database Name',
				T1.SchemaName as 'Schema name',
				T1.TableName as 'Table Name',
				R.Count as 'Number of times table was referenced in workload' ,
				CAST(ROUND(R.Usage,2) as decimal(10,2)) as 'Percentage usage'
		FROM 
				[msdb].[dbo].[DTA_reports_database] as D1 ,
				[msdb].[dbo].[DTA_reports_table] as T1,
				(
					SELECT D.DatabaseID,T.TableID 
							,SUM(Q.Weight) as Count,
							100.0 *  SUM(Q.Weight) / 
							( 1.0 * (	SELECT	CASE WHEN SUM(Q.Weight) > 0 THEN  SUM(Q.Weight)
												ELSE 1
												END	
									
										FROM [msdb].[dbo].[DTA_reports_query] AS Q, 
										[msdb].[dbo].[DTA_reports_querytable] AS QT
										WHERE QT.QueryID = Q.QueryID
										AND Q.SessionID = QT.SessionID and
										Q.SessionID = @SessionID ))
				AS Usage
		FROM 
				[msdb].[dbo].[DTA_reports_table] AS T
				LEFT OUTER JOIN
				[msdb].[dbo].[DTA_reports_querytable] AS QT ON QT.TableID = T.TableID
				LEFT OUTER JOIN
				[msdb].[dbo].[DTA_reports_query] AS Q ON QT.QueryID = Q.QueryID
				JOIN
				DTA_reports_database as D ON T.DatabaseID = D.DatabaseID
				AND Q.SessionID = QT.SessionID and 
				Q.SessionID = @SessionID		
				GROUP BY T.TableID,D.DatabaseID) as R
				WHERE R.DatabaseID = D1.DatabaseID and
				R.TableID = T1.TableID and
				D1.SessionID = @SessionID and
				R.Count > 0
				ORDER BY R.Count DESC
	END
	
	ELSE
	BEGIN

		SELECT	D1.DatabaseName as 'Database Name',
				T1.SchemaName as 'Schema name',
				T1.TableName as 'Table Name',
				R.Count as 'Number of times table was referenced in workload' ,
				CAST(ROUND(R.Usage,2) as decimal(10,2)) as 'Percentage usage'
		FROM 
				[msdb].[dbo].[DTA_reports_database] as D1 ,
				[msdb].[dbo].[DTA_reports_table] as T1,
				(
					SELECT D.DatabaseID,T.TableID 
							,SUM(Q.Weight) as Count,
							100.0 *  SUM(Q.Weight) / 
							( 1.0 * (	SELECT	CASE WHEN SUM(Q.Weight) > 0 THEN  SUM(Q.Weight)
												ELSE 1
												END	
									
										FROM [msdb].[dbo].[DTA_reports_query] AS Q, 
										[msdb].[dbo].[DTA_reports_querytable] AS QT
										WHERE QT.QueryID = Q.QueryID
										AND Q.SessionID = QT.SessionID and
										Q.SessionID = @SessionID ))
				AS Usage
		FROM 
				[msdb].[dbo].[DTA_reports_table] AS T
				LEFT OUTER JOIN
				DTA_reports_querytable AS QT ON QT.TableID = T.TableID
				LEFT OUTER JOIN
				DTA_reports_query AS Q ON QT.QueryID = Q.QueryID
				JOIN
				DTA_reports_database as D ON T.DatabaseID = D.DatabaseID
				AND Q.SessionID = QT.SessionID and 
				Q.SessionID = @SessionID		
				GROUP BY T.TableID,D.DatabaseID) as R
				WHERE R.DatabaseID = D1.DatabaseID and
				R.TableID = T1.TableID and
				D1.SessionID = @SessionID and
				R.Count > 0
				ORDER BY R.Count DESC
				FOR XML RAW	
	END
	
END
go
GRANT EXEC ON sp_DTA_tableaccesshelper TO PUBLIC
go
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_columnaccesshelper' AND type = 'P')
   DROP PROCEDURE sp_DTA_columnaccesshelper 
go
CREATE PROCEDURE sp_DTA_columnaccesshelper
	@SessionID		int,
	@XMLType		int
AS
BEGIN
	IF @XMLType = 0
	BEGIN
		SELECT	D1.DatabaseName as 'Database Name',
				T1.SchemaName as 'Schema name',
				T1.TableName as 'Table Name',
				C1.ColumnName as 'Column Name',
				R.Count as 'Number of times column was referenced in workload' ,
				CAST(ROUND(R.Usage,2) as decimal(10,2)) as 'Percentage usage'
		FROM 
				[msdb].[dbo].[DTA_reports_database] as D1 ,
				[msdb].[dbo].[DTA_reports_table] as T1,
				[msdb].[dbo].[DTA_reports_column] as C1,
			
				(
					SELECT D.DatabaseID,T.TableID,C.ColumnID,
							SUM(Q.Weight) as Count,
							100.0 *  SUM(Q.Weight) / 
							( 1.0 * (	SELECT	CASE WHEN SUM(Q.Weight) > 0 THEN  SUM(Q.Weight)
												ELSE 1
												END	
									
										FROM [msdb].[dbo].[DTA_reports_query] AS Q, 
										[msdb].[dbo].[DTA_reports_querycolumn] AS QC
										WHERE QC.QueryID = Q.QueryID
										AND Q.SessionID = QC.SessionID and
										Q.SessionID = @SessionID ))
				AS Usage
		FROM 
				[msdb].[dbo].[DTA_reports_column] AS C
				LEFT OUTER JOIN
				DTA_reports_querycolumn AS QC ON QC.ColumnID = C.ColumnID
				LEFT OUTER JOIN
				DTA_reports_query AS Q ON QC.QueryID = Q.QueryID
				JOIN
				DTA_reports_table as T ON C.TableID = T.TableID
				JOIN
				DTA_reports_database as D ON T.DatabaseID = D.DatabaseID
				AND Q.SessionID = QC.SessionID and 
				Q.SessionID = @SessionID		
				GROUP BY C.ColumnID,T.TableID,D.DatabaseID) as R
				WHERE R.DatabaseID = D1.DatabaseID and
				R.TableID = T1.TableID and
				R.ColumnID = C1.ColumnID and
				D1.SessionID = @SessionID and
				R.Count > 0
				ORDER BY R.Count DESC
		
	END
	ELSE
	BEGIN

		SELECT	D1.DatabaseName as 'Database Name',
				T1.SchemaName as 'Schema name',
				T1.TableName as 'Table Name',
				C1.ColumnName as 'Column Name',
				R.Count as 'Number of times column was referenced in workload' ,
				CAST(ROUND(R.Usage,2) as decimal(10,2)) as 'Percentage usage'
		FROM 
				[msdb].[dbo].[DTA_reports_database] as D1 ,
				[msdb].[dbo].[DTA_reports_table] as T1,
				[msdb].[dbo].[DTA_reports_column] as C1,
			
				(
					SELECT D.DatabaseID,T.TableID,C.ColumnID,
							SUM(Q.Weight) as Count,
							100.0 *  SUM(Q.Weight) / 
							( 1.0 * (	SELECT	CASE WHEN SUM(Q.Weight) > 0 THEN  SUM(Q.Weight)
												ELSE 1
												END	
									
										FROM [msdb].[dbo].[DTA_reports_query] AS Q, 
										[msdb].[dbo].[DTA_reports_querycolumn] AS QC
										WHERE QC.QueryID = Q.QueryID
										AND Q.SessionID = QC.SessionID and
										Q.SessionID = @SessionID ))
				AS Usage
		FROM 
				[msdb].[dbo].[DTA_reports_column] AS C
				LEFT OUTER JOIN
				[msdb].[dbo].[DTA_reports_querycolumn] AS QC ON QC.ColumnID = C.ColumnID
				LEFT OUTER JOIN
				[msdb].[dbo].[DTA_reports_query] AS Q ON QC.QueryID = Q.QueryID
				JOIN
				[msdb].[dbo].[DTA_reports_table] as T ON C.TableID = T.TableID
				JOIN
				[msdb].[dbo].[DTA_reports_database] as D ON T.DatabaseID = D.DatabaseID
				AND Q.SessionID = QC.SessionID and 
				Q.SessionID = @SessionID		
				GROUP BY C.ColumnID,T.TableID,D.DatabaseID) as R
				WHERE R.DatabaseID = D1.DatabaseID and
				R.TableID = T1.TableID and
				R.ColumnID = C1.ColumnID and
				D1.SessionID = @SessionID and
				R.Count > 0
				ORDER BY R.Count DESC
				FOR XML RAW	
	END
END
go
GRANT EXEC ON sp_DTA_columnaccesshelper TO PUBLIC
go
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_queryCRhelper' AND type = 'P')
   DROP PROCEDURE sp_DTA_queryCRhelper 
go
CREATE PROCEDURE sp_DTA_queryCRhelper
	@SessionID	int,
	@Current	int,
	@XMLType	int
AS
BEGIN
	DECLARE @maxCost float
	DECLARE @minCost float
							
	SET NOCOUNT ON

	SELECT @minCost = min(CurrentCost),@maxCost = max(CurrentCost)
	FROM [msdb].[dbo].[DTA_reports_query]
	where SessionID = @SessionID

	IF @maxCost = @minCost
		RETURN

	CREATE TABLE #tempTable(OutputString nvarchar(30),Value int)

	INSERT INTO #tempTable VALUES(N'0% - 10%',0)
	INSERT INTO #tempTable VALUES(N'11% - 20%',1)
	INSERT INTO #tempTable VALUES(N'21% - 30%',2)
	INSERT INTO #tempTable VALUES(N'31% - 40%',3)
	INSERT INTO #tempTable VALUES(N'41% - 50%',4)
	INSERT INTO #tempTable VALUES(N'51% - 60%',5)
	INSERT INTO #tempTable VALUES(N'61% - 70%',6)
	INSERT INTO #tempTable VALUES(N'71% - 80%',7)
	INSERT INTO #tempTable VALUES(N'81% - 90%',8)
	INSERT INTO #tempTable VALUES(N'91% - 100%',9)

	IF @Current = 0 
	BEGIN
	
		IF @XMLType = 0	 
		BEGIN
		
			SELECT 
				'Cost range (with respect to overall workload cost)'=OutputString, 
				'Number of queries in this range ' = count(NumStmts)
			FROM 
				#tempTable T1 
				LEFT OUTER JOIN 
				(
					SELECT CASE WHEN NumStmts = 10 THEN 9 
					ELSE NumStmts END AS NumStmts
					FROM (
						SELECT CONVERT(int,floor(10*(RecommendedCost-@minCost)/(@maxCost-@minCost))) as NumStmts
						FROM  [msdb].[dbo].[DTA_reports_query]
						where RecommendedCost between @minCost and @maxCost
						and SessionID = @SessionID
						) T2
				)T3 
				ON T1.Value = T3.NumStmts
				GROUP BY T1.Value,T1.OutputString
		END	
		
		ELSE
			BEGIN
				SELECT 
					'Cost range (with respect to overall workload cost)'=OutputString, 
					'Number of queries in this range ' = count(NumStmts)
				FROM 
					#tempTable T1 
					LEFT OUTER JOIN 
					(
						SELECT CASE WHEN NumStmts = 10 THEN 9 
						ELSE NumStmts END AS NumStmts
						FROM (
							SELECT CONVERT(int,floor(10*(RecommendedCost-@minCost)/(@maxCost-@minCost))) as NumStmts
							FROM  [msdb].[dbo].[DTA_reports_query]
							where RecommendedCost between @minCost and @maxCost
							and SessionID = @SessionID
							) T2
					)T3 
					ON T1.Value = T3.NumStmts
					GROUP BY T1.Value,T1.OutputString
					FOR XML RAW
			END			
		
	END
	
	
	ELSE
	BEGIN
	
		IF @XMLType = 0	 
		BEGIN
		
			SELECT 
				'Cost range (with respect to overall workload cost)'=OutputString, 
				'Number of queries in this range ' = count(NumStmts)
			FROM 
				#tempTable T1 
				LEFT OUTER JOIN 
				(
					SELECT CASE WHEN NumStmts = 10 THEN 9 
					ELSE NumStmts END AS NumStmts
					FROM (
						SELECT CONVERT(int,floor(10*(CurrentCost-@minCost)/(@maxCost-@minCost))) as NumStmts
						FROM  [msdb].[dbo].[DTA_reports_query]
						where CurrentCost between @minCost and @maxCost
						and SessionID = @SessionID
						) T2
				)T3 
				ON T1.Value = T3.NumStmts
				GROUP BY T1.Value,T1.OutputString
		END	
		
		ELSE
			BEGIN
				SELECT 
					'Cost range (with respect to overall workload cost)'=OutputString, 
					'Number of queries in this range ' = count(NumStmts)
				FROM 
					#tempTable T1 
					LEFT OUTER JOIN 
					(
						SELECT CASE WHEN NumStmts = 10 THEN 9 
						ELSE NumStmts END AS NumStmts
						FROM (
							SELECT CONVERT(int,floor(10*(CurrentCost-@minCost)/(@maxCost-@minCost))) as NumStmts
							FROM  [msdb].[dbo].[DTA_reports_query]
							where CurrentCost between @minCost and @maxCost
							and SessionID = @SessionID
							) T2
					)T3 
					ON T1.Value = T3.NumStmts
					GROUP BY T1.Value,T1.OutputString
					FOR XML RAW
			END			
		
	END
		DROP TABLE #tempTable

END

go
GRANT EXEC ON sp_DTA_queryCRhelper TO PUBLIC
go

/* sp_dta_get_session_report
	@SessionID,		- ID of a session requested
	@ReportID,		- ID of a report requested
	@ReportType		- report format:
					0  rowset
					1 - XML - This argument is ignored for now*/

IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_session_report' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_session_report 
go
CREATE PROCEDURE sp_DTA_get_session_report 
	@SessionID int, 
	@ReportID int,
	@ReportType int
AS 
BEGIN
	SET NOCOUNT ON

	IF @ReportType = 0
	BEGIN
		/**************************************************************/
		/* Query Cost Report                                          */
		/**************************************************************/
		IF @ReportID = 2
		BEGIN
			SELECT 	'Statement String'=StatementString,
			'Percent Improvement'= 		
			CASE
				WHEN CurrentCost = 0 THEN 0.00
				WHEN CurrentCost <> 0 THEN
				CAST(ROUND(100.0*(CurrentCost - RecommendedCost)/CurrentCost,2) as decimal (10,2))
			END ,
			'Weight' = Weight
			FROM [msdb].[dbo].[DTA_reports_query]
			WHERE SessionID=@SessionID
			ORDER BY 'Percent Improvement' DESC
		END
		/**************************************************************/
		/* Event Frequency Report                                     */
		/**************************************************************/
		ELSE IF @ReportID = 3
		BEGIN
			SELECT 
			'Event String'= EventString,
			'Weight'= EventWeight
			FROM [msdb].[dbo].[DTA_reports_query]
			WHERE SessionID=@SessionID and EventWeight>0
			ORDER BY EventWeight DESC
		END	
		/**************************************************************/
		/* Query Detail Report                                        */
		/**************************************************************/
		ELSE IF @ReportID = 4
		BEGIN
		SELECT 
			'Statement String'=StatementString,
			Type = CASE 
					WHEN StatementType = 0 THEN 'Select'
					WHEN StatementType = 1 THEN 'Insert'
					WHEN StatementType = 2 THEN 'Update'
					WHEN StatementType = 3 THEN 'Delete'
					END,
			'Cost of the statement'=CAST(ROUND(CurrentCost,2) as decimal(10,2)),
			'Cost of the statement with recommended configuration'=CAST(ROUND(RecommendedCost,2) as decimal(10,2)),
			Weight
		FROM [msdb].[dbo].[DTA_reports_query]
		WHERE SessionID=@SessionID
		END	
		/**************************************************************/
		/* Current Query Index Relations Report                        */
		/**************************************************************/
		ELSE IF @ReportID = 5
		BEGIN
			SELECT 
				'Statement String'=Q.StatementString,
				'Database Name'=D.DatabaseName,
				'Schema Name'=T.SchemaName,
				'Table Name'=T.TableName,
				'Index Name'=I.IndexName,
				'Type description'= 
				CASE
					WHEN I.IsClustered = 1 THEN 'Clustered'		
					WHEN I.IsClustered = 0 THEN 'Non Clustered'
				END,
				'Unique'= I.IsUnique
				FROM 
					[msdb].[dbo].[DTA_reports_query] Q, 
					[msdb].[dbo].[DTA_reports_queryindex] QI, 
					[msdb].[dbo].[DTA_reports_index] I, 
					[msdb].[dbo].[DTA_reports_table] T,
					[msdb].[dbo].[DTA_reports_database] D
			WHERE 
				Q.SessionID=QI.SessionID and 
				Q.QueryID=QI.QueryID and 
				QI.IndexID=I.IndexID and 
				I.TableID=T.TableID and 
				T.DatabaseID = D.DatabaseID and
				QI.IsRecommendedConfiguration = 0 and
				Q.SessionID=@SessionID
		END	
		/**************************************************************/
		/* Recommended Query Index Relations Report                   */
		/**************************************************************/
		ELSE IF @ReportID = 6
		BEGIN
			SELECT 
				'Statement String'=Q.StatementString,
				'Database Name'=D.DatabaseName,
				'Schema Name'=T.SchemaName,
				'Table Name'=T.TableName,
				'Index Name'=I.IndexName,
				'Type description'= 
				CASE
					WHEN I.IsClustered = 1 THEN 'Clustered'		
					WHEN I.IsClustered = 0 THEN 'Non Clustered'
				END,
				'Unique'= I.IsUnique
				FROM 
					[msdb].[dbo].[DTA_reports_query] Q, 
					[msdb].[dbo].[DTA_reports_queryindex] QI, 
					[msdb].[dbo].[DTA_reports_index] I, 
					[msdb].[dbo].[DTA_reports_table] T,
					[msdb].[dbo].[DTA_reports_database] D
			WHERE 
				Q.SessionID=QI.SessionID and 
				Q.QueryID=QI.QueryID and 
				QI.IndexID=I.IndexID and 
				I.TableID=T.TableID and 
				T.DatabaseID = D.DatabaseID and
				QI.IsRecommendedConfiguration = 1 and
				Q.SessionID=@SessionID
		END	
		/**************************************************************/
		/* Current Query Cost Range		                             */
		/**************************************************************/
		ELSE IF @ReportID = 7
		BEGIN
			EXEC sp_DTA_queryCRhelper @SessionID,1,0
		END
		/**************************************************************/
		/* Recommended Query Cost Range		                             */
		/**************************************************************/
		ELSE IF @ReportID = 8
		BEGIN
			EXEC sp_DTA_queryCRhelper @SessionID,0,0
		END
		/**************************************************************/
		/* Current Query Index Usage Report		                             */
		/**************************************************************/
		ELSE IF @ReportID = 9
		BEGIN
			EXEC sp_DTA_indexusagehelper @SessionID,0,0
		END
		/**************************************************************/
		/* Recommended Query Index Usage Report		                             */
		/**************************************************************/
		ELSE IF @ReportID = 10
		BEGIN
			EXEC sp_DTA_indexusagehelper @SessionID,1,0
		END
	
		/**************************************************************/
		/* Current Index Detail Report                                */
		/**************************************************************/
		ELSE IF @ReportID = 11
		BEGIN
			select 'Database Name'=D.DatabaseName,'Schema Name'=T.SchemaName,
			'Table Name' = T.TableName,'Index Name'= I.IndexName,
			'Type Description'=	
				CASE
				WHEN I.IsClustered = 1 THEN 'Clustered'		
				WHEN I.IsClustered = 0 THEN 'Non Clustered'
				END,
				'Unique'= I.IsUnique,
			'Storage' = I.Storage,
			'Number of Rows' = NumRows
			from 
				DTA_reports_database  D,
				DTA_reports_table T,
				DTA_reports_index as I
			where
				D.SessionID = @SessionID and
				D.DatabaseID = T.DatabaseID and
				T.TableID = I.TableID and
				I.IsExisting = 1
		END	
		/**************************************************************/
		/* Recommended Index Detail Report                                */
		/**************************************************************/
		ELSE IF @ReportID = 12
		BEGIN
			select 'Database Name'=D.DatabaseName,'Schema Name'=T.SchemaName,
			'Table Name' = T.TableName,'Index Name'= I.IndexName,
			'Type Description'=	
				CASE
				WHEN I.IsClustered = 1 THEN 'Clustered'		
				WHEN I.IsClustered = 0 THEN 'Non Clustered'
				END,
				'Unique'= I.IsUnique,
			'Storage' = I.Storage,
			'Number of Rows' = NumRows
			from 
				DTA_reports_database  D,
				DTA_reports_table T,
				DTA_reports_index as I
			where
				D.SessionID = @SessionID and
				D.DatabaseID = T.DatabaseID and
				T.TableID = I.TableID and
				I.IsExisting = 0
		END	
		/**************************************************************/
		/* View Table Relations Report                                */
		/**************************************************************/
		ELSE IF @ReportID = 13
		BEGIN
		SELECT 
			'Table Schema Name'=T1.SchemaName,
			'Table Name'=T1.TableName,
			'View Schema'=T2.SchemaName,
			'View Name'=T2.TableName
		FROM 
			[msdb].[dbo].[DTA_reports_database] D, 
			[msdb].[dbo].[DTA_reports_tableview] TV, 
			[msdb].[dbo].[DTA_reports_table] T1,
		[msdb].[dbo].[DTA_reports_table] T2
		WHERE 
			D.DatabaseID=T1.DatabaseID and 
			D.DatabaseID=T2.DatabaseID and
			T1.TableID=TV.TableID and 
			T2.TableID=TV.ViewID and
			D.SessionID=@SessionID
		END	

		/**************************************************************/
		/* Workload Analysis Report                                   */
		/**************************************************************/

		ELSE IF @ReportID = 14
		BEGIN
			SELECT 
			'StatementType' = CASE 
			WHEN StatementType = 0 THEN 'Select'
			WHEN StatementType = 1 THEN 'Insert'
			WHEN StatementType = 2 THEN 'Update'
			WHEN StatementType = 3 THEN 'Delete'
			END,
			'NumberOfQueries'=COUNT(QueryID),
			'NumberOfQueriesCostDecreased'=SUM(CASE
			WHEN RecommendedCost<CurrentCost THEN 1 ELSE 0 END),
			'NumberOfQueriesCostIncreased'=SUM(CASE
			WHEN RecommendedCost>CurrentCost THEN 1 ELSE 0 END),
			'NumberOfQueriesWithNoCostChange'=SUM(CASE
			WHEN RecommendedCost=CurrentCost THEN 1 ELSE 0 END)
			FROM 
			[msdb].[dbo].[DTA_reports_query]
			WHERE 
			SessionID=@SessionID group by StatementType
		END	
		ELSE IF @ReportID = 15
		BEGIN
			EXEC sp_DTA_databaseaccesshelper @SessionID,0
		END
		ELSE IF @ReportID = 16
		BEGIN
			EXEC sp_DTA_tableaccesshelper @SessionID,0
		END
		ELSE IF @ReportID = 17
		BEGIN
			EXEC sp_DTA_columnaccesshelper @SessionID,0
		END

	END
	
	
	ELSE IF @ReportType = 1
	BEGIN
		/**************************************************************/
		/* Query Cost Report                                          */
		/**************************************************************/
		IF @ReportID = 2
		BEGIN
			SELECT 	'Statement String'=StatementString,
			'Percent Improvement'= 		
			CASE
			WHEN CurrentCost = 0 THEN 0.00
			WHEN CurrentCost <> 0 THEN
			CAST(ROUND(100.0*(CurrentCost - RecommendedCost)/CurrentCost,2) as decimal (10,2))
			END,
			'Weight' = Weight
			FROM [msdb].[dbo].[DTA_reports_query]
			WHERE SessionID=@SessionID
			FOR XML RAW
		END
		/**************************************************************/
		/* Event Weight Report                                     */
		/**************************************************************/
		ELSE IF @ReportID = 3
		BEGIN
			SELECT 
			'Event String'= EventString,
			'Weight'= EventWeight
			FROM [msdb].[dbo].[DTA_reports_query]
			FOR XML RAW
		END	
		/**************************************************************/
		/* Query Detail Report                                        */
		/**************************************************************/
		ELSE IF @ReportID = 4
		BEGIN
		SELECT 
			Type = CASE 
					WHEN StatementType = 0 THEN 'Select'
					WHEN StatementType = 1 THEN 'Insert'
					WHEN StatementType = 2 THEN 'Update'
					WHEN StatementType = 3 THEN 'Delete'
					END,
			'Cost of the statement'=CAST(ROUND(CurrentCost,2) as decimal(10,2)),
			'Cost of the statement with recommended configuration'=CAST(ROUND(RecommendedCost,2) as decimal(10,2)),
			Weight,
			'Statement String'=StatementString
		FROM [msdb].[dbo].[DTA_reports_query]
		WHERE SessionID=@SessionID
		FOR XML RAW
		END	
		/**************************************************************/
		/* Current Query Index Relations Report                       */
		/**************************************************************/
		ELSE IF @ReportID = 5
		BEGIN
			SELECT 
				'Statement String'=Q.StatementString,
				'Database Name'=D.DatabaseName,
				'Schema Name'=T.SchemaName,
				'Table Name'=T.TableName,
				'Index Name'=I.IndexName,
				'Type description'= 
				CASE
					WHEN I.IsClustered = 1 THEN 'Clustered'		
					WHEN I.IsClustered = 0 THEN 'Non Clustered'
				END,
				'Unique'= I.IsUnique
				FROM 
				[msdb].[dbo].[DTA_reports_query] Q, 
				[msdb].[dbo].[DTA_reports_queryindex] QI, 
				[msdb].[dbo].[DTA_reports_index] I, 
				[msdb].[dbo].[DTA_reports_table] T,
				[msdb].[dbo].[DTA_reports_database] D
			WHERE 
				Q.SessionID=QI.SessionID and 
				Q.QueryID=QI.QueryID and 
				QI.IndexID=I.IndexID and 
				I.TableID=T.TableID and 
				T.DatabaseID = D.DatabaseID and
				QI.IsRecommendedConfiguration = 0 and
				Q.SessionID=@SessionID
				FOR XML RAW
		END	
		/**************************************************************/
		/* Current Query Index Relations Report                       */
		/**************************************************************/
		ELSE IF @ReportID = 6
		BEGIN
			SELECT 
				'Statement String'=Q.StatementString,
				'Database Name'=D.DatabaseName,
				'Schema Name'=T.SchemaName,
				'Table Name'=T.TableName,
				'Index Name'=I.IndexName,
				'Type description'= 
				CASE
					WHEN I.IsClustered = 1 THEN 'Clustered'		
					WHEN I.IsClustered = 0 THEN 'Non Clustered'
				END,
				'Unique'= I.IsUnique
				FROM 
				[msdb].[dbo].[DTA_reports_query] Q, 
				[msdb].[dbo].[DTA_reports_queryindex] QI, 
				[msdb].[dbo].[DTA_reports_index] I, 
				[msdb].[dbo].[DTA_reports_table] T,
				[msdb].[dbo].[DTA_reports_database] D
			WHERE 
				Q.SessionID=QI.SessionID and 
				Q.QueryID=QI.QueryID and 
				QI.IndexID=I.IndexID and 
				I.TableID=T.TableID and 
				T.DatabaseID = D.DatabaseID and
				QI.IsRecommendedConfiguration = 1 and
				Q.SessionID=@SessionID
				FOR XML RAW
		END	
		/**************************************************************/
		/* Current Query Cost Range		                             */
		/**************************************************************/
		ELSE IF @ReportID = 7
		BEGIN
			EXEC sp_DTA_queryCRhelper @SessionID,1,1
		END
		/**************************************************************/
		/* Recommended Query Cost Range		                             */
		/**************************************************************/
		ELSE IF @ReportID = 8
		BEGIN
			EXEC sp_DTA_queryCRhelper @SessionID,0,1
		END
		/**************************************************************/
		/* Current Query Index Usage Report		                             */
		/**************************************************************/
		ELSE IF @ReportID = 9
		BEGIN
			EXEC sp_DTA_indexusagehelper @SessionID,0,1
		END
		/**************************************************************/
		/* Recommended Query Index Usage Report		                             */
		/**************************************************************/
		ELSE IF @ReportID = 10
		BEGIN
			EXEC sp_DTA_indexusagehelper @SessionID,1,1
		END	
		
		/**************************************************************/
		/* Current Index Detail Report                                */
		/**************************************************************/
		ELSE IF @ReportID = 11
		BEGIN
			select 'Database Name'=D.DatabaseName,'Schema Name'=T.SchemaName,
			'Table Name' = T.TableName,'Index Name'= I.IndexName,
			'Type Description'=	
				CASE
				WHEN I.IsClustered = 1 THEN 'Clustered'		
				WHEN I.IsClustered = 0 THEN 'Non Clustered'
				END,
				'Unique'= I.IsUnique,
			'Storage' = I.Storage,
			'Number of Rows' = NumRows
			from 
				DTA_reports_database  D,
				DTA_reports_table T,
				DTA_reports_index as I
			where
				D.SessionID = @SessionID and
				D.DatabaseID = T.DatabaseID and
				T.TableID = I.TableID and
				I.IsExisting = 1
				FOR XML RAW
		END	
		/**************************************************************/
		/* Recommended Index Detail Report                                */
		/**************************************************************/
		ELSE IF @ReportID = 12
		BEGIN
			select 'Database Name'=D.DatabaseName,'Schema Name'=T.SchemaName,
			'Table Name' = T.TableName,'Index Name'= I.IndexName,
			'Type Description'=	
				CASE
				WHEN I.IsClustered = 1 THEN 'Clustered'		
				WHEN I.IsClustered = 0 THEN 'Non Clustered'
				END,
				'Unique'= I.IsUnique,
			'Storage' = I.Storage,
			'Number of Rows' = NumRows
			from 
				DTA_reports_database  D,
				DTA_reports_table T,
				DTA_reports_index as I
			where
				D.SessionID = @SessionID and
				D.DatabaseID = T.DatabaseID and
				T.TableID = I.TableID and
				I.IsExisting = 0
				FOR XML RAW
		END	
		
		/**************************************************************/
		/* View Table Relations Report                                */
		/**************************************************************/
		ELSE IF @ReportID = 13
		BEGIN
		SELECT 
			'TableSchema'=T1.SchemaName,
			'TableName'=T1.TableName,
			'ViewSchema'=T2.SchemaName,
			'ViewName'=T2.TableName
		FROM 
			[msdb].[dbo].[DTA_reports_database] D, 
			[msdb].[dbo].[DTA_reports_tableview] TV, 
			[msdb].[dbo].[DTA_reports_table] T1,
		[msdb].[dbo].[DTA_reports_table] T2
		WHERE 
			D.DatabaseID=T1.DatabaseID and 
			D.DatabaseID=T2.DatabaseID and
			T1.TableID=TV.TableID and 
			T2.TableID=TV.ViewID and
			D.SessionID=@SessionID
			FOR XML RAW
		END	

		/**************************************************************/
		/* Workload Analysis Report                                   */
		/**************************************************************/

		ELSE IF @ReportID = 14
		BEGIN
			SELECT 
			'StatementType' = CASE 
			WHEN StatementType = 0 THEN 'Select'
			WHEN StatementType = 1 THEN 'Insert'
			WHEN StatementType = 2 THEN 'Update'
			WHEN StatementType = 3 THEN 'Delete'
			END,
			'NumberOfQueries'=COUNT(QueryID),
			'NumberOfQueriesCostDecreased'=SUM(CASE
			WHEN RecommendedCost<CurrentCost THEN 1 ELSE 0 END),
			'NumberOfQueriesCostIncreased'=SUM(CASE
			WHEN RecommendedCost>CurrentCost THEN 1 ELSE 0 END),
			'NumberOfQueriesWithNoCostChange'=SUM(CASE
			WHEN RecommendedCost=CurrentCost THEN 1 ELSE 0 END)
			FROM 
			[msdb].[dbo].[DTA_reports_query]
			WHERE 
			SessionID=@SessionID group by StatementType
			FOR XML RAW
		END	
		ELSE IF @ReportID = 15
		BEGIN
			EXEC sp_DTA_databaseaccesshelper @SessionID,1
		END
		ELSE IF @ReportID = 16
		BEGIN
			EXEC sp_DTA_tableaccesshelper @SessionID,1
		END
		ELSE IF @ReportID = 17
		BEGIN
			EXEC sp_DTA_columnaccesshelper @SessionID,1
		END
	END
END	
go
GRANT EXEC ON sp_DTA_get_session_report TO PUBLIC
/*
	Stored procs used by DTAEngine
*/

/* sp_DTA_set_tuninglogtablename
	@LogTableName - Tuning Log table name 
	@SessionID,		- ID of a session requested
*/


IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_set_tuninglogtablename' AND type = 'P')
   DROP PROCEDURE sp_DTA_set_tuninglogtablename 
go
CREATE PROCEDURE sp_DTA_set_tuninglogtablename
	@LogTableName nvarchar(128), 
	@SessionID int 

AS 
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	update [msdb].[dbo].[DTA_input] set LogTableName = @LogTableName WHERE SessionID = @SessionID
	

END	
go
GRANT EXEC ON sp_DTA_set_tuninglogtablename TO PUBLIC
go


/* sp_DTA_get_tuningoptions
	@SessionID	- ID of a session requested
	Gets the tuning options FROM [msdb].[dbo].[DTA_input] for this session
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_tuningoptions' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_tuningoptions 
go
CREATE PROCEDURE sp_DTA_get_tuningoptions
	@SessionID int 

AS 
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	SELECT TuningOptions FROM [msdb].[dbo].[DTA_input] WHERE SessionID = @SessionID	

END	
go
GRANT EXEC ON sp_DTA_get_tuningoptions TO PUBLIC
go


/* sp_DTA_get_interactivestatus
	@SessionID	- ID of a session requested
	Gets the interactivestatus bit FROM DTA_input
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_interactivestatus' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_interactivestatus 
go
CREATE PROCEDURE sp_DTA_get_interactivestatus
	@SessionID int 

AS 
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	SELECT InteractiveStatus FROM [msdb].[dbo].[DTA_input] WHERE SessionID = @SessionID
END	
go
GRANT EXEC ON sp_DTA_get_interactivestatus TO PUBLIC
go

/* sp_DTA_insert_progressinformation
	@SessionID	- ID of a session requested
	Inserts the progress information in DTA_Progress table
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_progressinformation' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_progressinformation
go
CREATE PROCEDURE sp_DTA_insert_progressinformation
	@SessionID int,
	@TuningStage int
AS 
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	INSERT into [msdb].[dbo].[DTA_progress]
		(SessionID,WorkloadConsumption,EstImprovement,TuningStage)
	VALUES(@SessionID,0,0,@TuningStage)
	
END	
go
GRANT EXEC ON sp_DTA_insert_progressinformation TO PUBLIC
go



/* sp_DTA_set_progressinformation
	@SessionID	- ID of a session requested
	Sets the progress information in DTA_Progress table
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_set_progressinformation' AND type = 'P')
   DROP PROCEDURE sp_DTA_set_progressinformation
go
CREATE PROCEDURE sp_DTA_set_progressinformation
	@SessionID int,
	@WorkloadConsumption int,
	@TuningStage int,
	@EstImprovement int


AS 
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	UPDATE [msdb].[dbo].[DTA_progress]
	SET WorkloadConsumption = @WorkloadConsumption,
	EstImprovement = @EstImprovement,
	ProgressEventTime = GetDate()
	WHERE SessionID=@SessionID
	AND TuningStage = @TuningStage
END	
go
GRANT EXEC ON sp_DTA_set_progressinformation TO PUBLIC
go

/* sp_DTA_set_outputinformation
	@SessionID	- ID of a session requested
	@TuningResults - Tuning results 
	@FinishStatus - Finish status
	Sets the output information
*/
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_set_outputinformation' AND type = 'P')
   DROP PROCEDURE sp_DTA_set_outputinformation
go
CREATE PROCEDURE sp_DTA_set_outputinformation
	@SessionID int,
	@TuningResults ntext,
	@FinishStatus tinyint
AS 
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	
	Insert into [msdb].[dbo].[DTA_output]([SessionID], [TuningResults],[FinishStatus]) VALUES(@SessionID,@TuningResults,@FinishStatus)
END	
go
GRANT EXEC ON sp_DTA_set_outputinformation TO PUBLIC
go
/* sp_DTA_insert_reports_database
	@SessionID	int
	@DatabaseName sysname
*/

IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_database' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_database
go
CREATE PROCEDURE sp_DTA_insert_reports_database
	@SessionID	int,
	@DatabaseName sysname
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	
	Insert into [msdb].[dbo].[DTA_reports_database]([SessionID],[DatabaseName]) VALUES(@SessionID,@DatabaseName)
END	
go
GRANT EXEC ON sp_DTA_insert_reports_database TO PUBLIC
go


/* sp_DTA_insert_reports_partitionscheme
   @SessionID	int
   @PartitionFunctionID int
   @PartitionSchemeName sysname
   @PartitionSchemeDefinition ntext
*/

IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_partitionscheme' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_partitionscheme
go
CREATE PROCEDURE sp_DTA_insert_reports_partitionscheme
	@SessionID	int,   
	@PartitionFunctionID int,
	@PartitionSchemeName sysname,
	@PartitionSchemeDefinition ntext
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	
	Insert into [msdb].[dbo].[DTA_reports_partitionscheme]( [PartitionFunctionID],[PartitionSchemeName],[PartitionSchemeDefinition]) VALUES(@PartitionFunctionID,@PartitionSchemeName,@PartitionSchemeDefinition)
END	
go
GRANT EXEC ON sp_DTA_insert_reports_partitionscheme TO PUBLIC
go


/* sp_DTA_insert_reports_partitionfunction
	SessionID	int
	DatabaseID int
	PartitionFunctionName sysname
	PartitionFunctionDefinition ntext
*/

IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_partitionfunction' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_partitionfunction
go
CREATE PROCEDURE sp_DTA_insert_reports_partitionfunction
	@SessionID	int,
	@DatabaseID int,
	@PartitionFunctionName sysname,
	@PartitionFunctionDefinition ntext
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	
	Insert into [msdb].[dbo].[DTA_reports_partitionfunction]([DatabaseID],[PartitionFunctionName],[PartitionFunctionDefinition]) 
	VALUES(@DatabaseID,@PartitionFunctionName,@PartitionFunctionDefinition)
END	
go
GRANT EXEC ON sp_DTA_insert_reports_partitionfunction TO PUBLIC
go


/* sp_DTA_insert_reports_column
	@SessionID	int,
	@TableID int
	@ColumnName sysname
*/

IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_column' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_column
go
CREATE PROCEDURE sp_DTA_insert_reports_column
	@SessionID	int,
	@TableID int,
	@ColumnName sysname
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	
	INSERT INTO [msdb].[dbo].[DTA_reports_column]([TableID], [ColumnName])
		VALUES(	@TableID ,@ColumnName)

END	
go
GRANT EXEC ON sp_DTA_insert_reports_column TO PUBLIC
go

/* sp_DTA_insert_reports_tableview
	@SessionID	int,	
	@TableID	int,
	@ViewID		int
*/

IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_tableview' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_tableview
go
CREATE PROCEDURE sp_DTA_insert_reports_tableview
	@SessionID	int,
	@TableID	int,
	@ViewID		int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	INSERT INTO [msdb].[dbo].[DTA_reports_tableview]([TableID], [ViewID])
	VALUES(@TableID,@ViewID)
	

END	
go
GRANT EXEC ON sp_DTA_insert_reports_tableview TO PUBLIC
go

/* sp_DTA_insert_reports_query
	@SessionID			int
	@QueryID			int
	@StatementType		smallint
	@StatementString	ntext
	@CurrentCost		float
	@RecommendedCost	float
	@Weight				float
	@EventString		ntext
	@EventWeight		float
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_query' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_query
go
CREATE PROCEDURE sp_DTA_insert_reports_query
	@SessionID			int,
	@QueryID			int,
	@StatementType		smallint,
	@StatementString	ntext,
	@CurrentCost		float,
	@RecommendedCost	float,
	@Weight				float,
	@EventString		ntext,
	@EventWeight		float
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	INSERT INTO [msdb].[dbo].[DTA_reports_query]([SessionID],[QueryID], [StatementType], [StatementString], [CurrentCost], [RecommendedCost], [Weight], [EventString], [EventWeight])
	VALUES(@SessionID,@QueryID,@StatementType,@StatementString,@CurrentCost,@RecommendedCost,@Weight,@EventString,@EventWeight)
	

END	
go
GRANT EXEC ON sp_DTA_insert_reports_query TO PUBLIC
go

/* sp_DTA_insert_reports_index
	@SessionID			int
	@TableID			int
	@IndexName			sysname
	@IsClustered		bit
	@IsUnique			bit
	@IsMerged			bit
	@IsHeap				bit
	@IsExisting			bit
	@Storage			int
	@NumRows			int
	@PartitionSchemeID	int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_index' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_index
go
CREATE PROCEDURE sp_DTA_insert_reports_index
	@SessionID			int,
	@TableID			int,
	@IndexName			sysname,
	@IsClustered		bit,
	@IsUnique			bit,
	@IsMerged			bit,
	@IsHeap				bit,
	@IsExisting			bit,
	@Storage			int,
	@NumRows			int,
	@PartitionSchemeID	int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	INSERT INTO [msdb].[dbo].[DTA_reports_index]([TableID], [IndexName], [IsClustered], [IsUnique], [IsMerged], [IsHeap], [IsExisting], [Storage], [NumRows],  [PartitionSchemeID])	
	VALUES(@TableID,@IndexName,@IsClustered,@IsUnique,@IsMerged,@IsHeap,@IsExisting,@Storage,@NumRows,@PartitionSchemeID)
END	
go
GRANT EXEC ON sp_DTA_insert_reports_index TO PUBLIC
go


/* sp_DTA_insert_reports_table
	@SessionID	int
	@DatabaseID	int
	@SchemaName	sysname
	@TableName	sysname
	@IsView		bit
	@ViewDefinition	ntext
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_table' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_table
GO
CREATE PROCEDURE sp_DTA_insert_reports_table
	@SessionID	int,
	@DatabaseID	int,
	@SchemaName	sysname,
	@TableName	sysname,
	@IsView		bit,
	@ViewDefinition	ntext
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	INSERT INTO [msdb].[dbo].[DTA_reports_table]([DatabaseID], [SchemaName], [TableName], [IsView], [ViewDefinition])
	VALUES(@DatabaseID,@SchemaName,@TableName,@IsView,@ViewDefinition)
END	
GO
GRANT EXEC ON sp_DTA_insert_reports_table TO PUBLIC
GO


/* sp_DTA_insert_reports_queryindex
	@SessionID	int
	@QueryID	int
	@IndexID	int
	@IsRecommendedConfiguration	bit
	@Cost		float
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_queryindex' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_queryindex
go
CREATE PROCEDURE sp_DTA_insert_reports_queryindex
	@SessionID	int,
	@QueryID	int,
	@IndexID	int,
	@IsRecommendedConfiguration	bit
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	INSERT INTO [msdb].[dbo].[DTA_reports_queryindex]([SessionID],[QueryID],[IndexID], [IsRecommendedConfiguration])
	VALUES(@SessionID,@QueryID,@IndexID,@IsRecommendedConfiguration)
	
END	
go
GRANT EXEC ON sp_DTA_insert_reports_queryindex TO PUBLIC
go


/* sp_DTA_insert_reports_indexcolumn
	@SessionID		int
	@IndexID		int
	@ColumnID		int
	@ColumnOrder	int
	@PartitionColumnOrder	int
	@IsKeyColumn	bit
	@IsDescendingColumn	bit
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_indexcolumn' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_indexcolumn
go
CREATE PROCEDURE sp_DTA_insert_reports_indexcolumn
	@SessionID		int,
	@IndexID		int,
	@ColumnID		int,
	@ColumnOrder	int,
	@PartitionColumnOrder	int,
	@IsKeyColumn	bit,
	@IsDescendingColumn	bit
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	INSERT INTO [msdb].[dbo].[DTA_reports_indexcolumn]([IndexID], [ColumnID], [ColumnOrder], [PartitionColumnOrder], [IsKeyColumn], [IsDescendingColumn])
	VALUES(@IndexID,@ColumnID,@ColumnOrder,@PartitionColumnOrder,@IsKeyColumn,@IsDescendingColumn)
END	
go
GRANT EXEC ON sp_DTA_insert_reports_indexcolumn TO PUBLIC
go


/* sp_DTA_insert_reports_querytable
	@SessionID		int
	@QueryID		int
	@TableID		int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_querytable' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_querytable
go
CREATE PROCEDURE sp_DTA_insert_reports_querytable
	@SessionID		int,
	@QueryID		int,
	@TableID		int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	INSERT INTO [msdb].[dbo].[DTA_reports_querytable]([SessionID], [QueryID],[TableID])
	VALUES(@SessionID,@QueryID,@TableID)
END	
go
GRANT EXEC ON sp_DTA_insert_reports_querytable TO PUBLIC
go
/* sp_DTA_insert_reports_querydatabase
	@SessionID		int
	@QueryID		int
	@DatabaseID		int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_querydatabase' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_querydatabase
go
CREATE PROCEDURE sp_DTA_insert_reports_querydatabase
	@SessionID		int,
	@QueryID		int,
	@DatabaseID		int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	INSERT INTO [msdb].[dbo].[DTA_reports_querydatabase]([SessionID], [QueryID],[DatabaseID])
	VALUES(@SessionID,@QueryID,@DatabaseID)
END	
go
GRANT EXEC ON sp_DTA_insert_reports_querydatabase TO PUBLIC
go

/* sp_DTA_insert_reports_querycolumn
	@SessionID		int
	@QueryID		int
	@ColumnID		int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_reports_querycolumn' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_reports_querycolumn
go
CREATE PROCEDURE sp_DTA_insert_reports_querycolumn
	@SessionID		int,
	@QueryID		int,
	@ColumnID		int
AS	
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	INSERT INTO [msdb].[dbo].[DTA_reports_querycolumn]([QueryID], [ColumnID],[SessionID])
	VALUES(@QueryID,@ColumnID,@SessionID )
END	
go
GRANT EXEC ON sp_DTA_insert_reports_querycolumn TO PUBLIC
go


/* sp_DTA_insert_DTA_tuninglog
	@SessionID int
	@RowID int
	@CategoryID char(4)
	@Event ntext
	@Statement ntext
	@Frequency int
	@Reason ntext
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_insert_DTA_tuninglog' AND type = 'P')
   DROP PROCEDURE sp_DTA_insert_DTA_tuninglog
go
CREATE PROCEDURE sp_DTA_insert_DTA_tuninglog
	@SessionID int,
	@RowID int,
	@CategoryID char(4),
	@Event ntext,
	@Statement ntext,
	@Frequency int,
	@Reason ntext
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	
	INSERT INTO [msdb].[dbo].[DTA_tuninglog]([SessionID], [RowID], [CategoryID], [Event], [Statement], [Frequency], [Reason])
	VALUES(@SessionID, @RowID, @CategoryID, @Event, @Statement, @Frequency, @Reason)
END	
go
GRANT EXEC ON sp_DTA_insert_DTA_tuninglog TO PUBLIC
go



/* sp_DTA_get_databasetableids
	@SessionID	int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_databasetableids' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_databasetableids
go
CREATE PROCEDURE sp_DTA_get_databasetableids
	@SessionID	int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	SELECT DatabaseID,DatabaseName 
	FROM [msdb].[dbo].[DTA_reports_database] as D 
	WHERE D.SessionID = @SessionID

END	
go
GRANT EXEC ON sp_DTA_get_databasetableids TO PUBLIC
go


/* sp_DTA_get_pftableids
	@SessionID	int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_pftableids' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_pftableids
go
CREATE PROCEDURE sp_DTA_get_pftableids
	@SessionID	int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	SELECT PartitionFunctionID ,DatabaseName ,PartitionFunctionName  
	FROM [msdb].[dbo].[DTA_reports_partitionfunction]  as PF,
	[msdb].[dbo].[DTA_reports_database] as D 
	WHERE PF.DatabaseID = D.DatabaseID 
	and D.SessionID = @SessionID
	
END	
go
GRANT EXEC ON sp_DTA_get_pftableids TO PUBLIC
go



/* sp_DTA_get_pstableids
	@SessionID	int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_pstableids' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_pstableids
go
CREATE PROCEDURE sp_DTA_get_pstableids
	@SessionID	int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	SELECT PartitionSchemeID,DatabaseName,PartitionSchemeName   
	FROM [msdb].[dbo].[DTA_reports_partitionfunction]  as PF, 
	[msdb].[dbo].[DTA_reports_partitionscheme]  as PS, 
	[msdb].[dbo].[DTA_reports_database] as D 
	WHERE PS.PartitionFunctionID  = PF.PartitionFunctionID and 
	PF.DatabaseID = D.DatabaseID and D.SessionID = @SessionID	
	
END	
go
GRANT EXEC ON sp_DTA_get_pstableids TO PUBLIC
go



/* sp_DTA_get_tableids
	@SessionID	int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_tableids' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_tableids
go
CREATE PROCEDURE sp_DTA_get_tableids
	@SessionID	int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	SELECT TableID,DatabaseName,SchemaName,TableName 
	FROM [msdb].[dbo].[DTA_reports_table] as T,[msdb].[dbo].[DTA_reports_database] as D 
	WHERE T.DatabaseID = D.DatabaseID and D.SessionID = @SessionID


END	
go
GRANT EXEC ON sp_DTA_get_tableids TO PUBLIC
go

/* sp_DTA_get_columntableids
	@SessionID	int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_columntableids' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_columntableids
go
CREATE PROCEDURE sp_DTA_get_columntableids
	@SessionID	int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	SELECT ColumnID,DatabaseName,SchemaName,TableName,ColumnName 
	FROM [msdb].[dbo].[DTA_reports_column] as C,
	[msdb].[dbo].[DTA_reports_table] as T,[msdb].[dbo].[DTA_reports_database] as D 
	WHERE C.TableID = T.TableID and T.DatabaseID = D.DatabaseID and D.SessionID = @SessionID


END	
go
GRANT EXEC ON sp_DTA_get_columntableids TO PUBLIC
go


/* sp_DTA_get_indexableids
	@SessionID	int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_get_indexableids' AND type = 'P')
   DROP PROCEDURE sp_DTA_get_indexableids
go
CREATE PROCEDURE sp_DTA_get_indexableids
	@SessionID	int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	SELECT IndexID,DatabaseName,SchemaName,TableName,IndexName 
	FROM [msdb].[dbo].[DTA_reports_index] as I,[msdb].[dbo].[DTA_reports_table] as T,
	[msdb].[dbo].[DTA_reports_database] as D 
	WHERE I.TableID = T.TableID and T.DatabaseID = D.DatabaseID and D.SessionID = @SessionID 

END	
go
GRANT EXEC ON sp_DTA_get_indexableids TO PUBLIC
go

/* sp_DTA_update_tuninglog_errorfrequency
	@SessionID	int
	@RowID		int
	@Frequency int
*/ 	
IF EXISTS (SELECT name FROM msdb.dbo.sysobjects 
         WHERE name = 'sp_DTA_update_tuninglog_errorfrequency' AND type = 'P')
   DROP PROCEDURE sp_DTA_update_tuninglog_errorfrequency
go
CREATE PROCEDURE sp_DTA_update_tuninglog_errorfrequency
	@SessionID	int,
	@Frequency	int,
	@RowID		int
AS
BEGIN
	DECLARE @retval  int							
	SET NOCOUNT ON

	EXEC @retval =  sp_DTA_check_permission @SessionID

	IF @retval = 1
	BEGIN
		RAISERROR ('Not the owner of this session', 16, 1)
		RETURN(1)
	END	

	UPDATE [msdb].[dbo].[DTA_tuninglog]
	SET [Frequency]=@Frequency
	WHERE [RowID]=@RowID

END	
go
GRANT EXEC ON sp_DTA_update_tuninglog_errorfrequency TO PUBLIC
go

z/***************************************************************/
/* Make sure we are int the right database                     */
/***************************************************************/
use msdb
go

/**************************************************************/
/* Creating Report functions                                  */
/*                                                            */
/**************************************************************/

/**************************************************************/
/* Query Cost Report                                          */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_query_cost_report')
                  AND (type = 'IF')
                  AND (uid = USER_ID('dbo'))))
   DROP FUNCTION dbo.fn_DTA_query_cost_report
go

   CREATE FUNCTION dbo.fn_DTA_query_cost_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
      (
      select 
         StatementString,
         'PercentImprovement'= 
         CASE
            WHEN CurrentCost = 0 THEN 0
            WHEN CurrentCost <> 0 THEN 100.0*(CurrentCost - RecommendedCost)/CurrentCost
         END
      from DTA_reports_query
      where SessionID=@SessionID
      )
go

/**************************************************************/
/* Event Frequency Report                                     */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_event_frequency_report')
                  AND (type = 'IF')
                  AND (uid = USER_ID('dbo'))))
   DROP FUNCTION dbo.fn_DTA_event_frequency_report
go


   CREATE FUNCTION dbo.fn_DTA_event_frequency_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
         EventString,
         EventFrequency 
      from DTA_reports_query
      where SessionID=@SessionID and EventFrequency>0
   )
go

/**************************************************************/
/* Query Detail Report                                        */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_query_detail_report')
                  AND (type = 'IF')
                  AND (uid = USER_ID('dbo'))))
   DROP FUNCTION dbo.fn_DTA_query_detail_report
go


   CREATE FUNCTION dbo.fn_DTA_query_detail_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
         QueryID,
         Type = CASE 
                  WHEN StatementType = 0 THEN 'Select'
                  WHEN StatementType = 1 THEN 'Insert'
                  WHEN StatementType = 2 THEN 'Update'
                  WHEN StatementType = 3 THEN 'Delete'
                END,
         CurrentCost,
         RecommendedCost,
         Frequency,
         StatementString
      from DTA_reports_query
      where SessionID=@SessionID
   )
go

/**************************************************************/
/* Query Index Relations Report                               */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_query_index_relations_report')
                  AND (type = 'IF')
                  AND (uid = USER_ID('dbo'))))
   DROP FUNCTION dbo.fn_DTA_query_index_relations_report
go


   CREATE FUNCTION dbo.fn_DTA_query_index_relations_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
         Q.StatementString,
         T.TableName,
         I.IndexName,
         I.IsClustered,
         I.IsUnique
      from 
         DTA_reports_query Q, 
         DTA_reports_queryindex QI, 
         DTA_reports_index I, 
         DTA_reports_table T
      where 
         Q.SessionID=QI.SessionID and 
         Q.QueryID=QI.QueryID and 
         QI.IndexID=I.IndexID and 
         I.TableID=T.TableID and 
         Q.SessionID=@SessionID
   )
go


/**************************************************************/
/* View Table Relations Report                                */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_view_table_relations_report')
                  AND (type = 'IF')
                  AND (uid = USER_ID('dbo'))))
   DROP FUNCTION dbo.fn_DTA_view_table_relations_report
go


   CREATE FUNCTION dbo.fn_DTA_view_table_relations_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
         'TableSchema'=T1.SchemaName,
         'TableName'=T1.TableName,
         'ViewSchema'=T2.SchemaName,
         'ViewName'=T2.TableName
      from 
         DTA_reports_database D, 
         DTA_reports_tableview TV, 
         DTA_reports_table T1,
	 DTA_reports_table T2
      where 
         D.DatabaseID=T1.DatabaseID and 
         D.DatabaseID=T2.DatabaseID and
         T1.TableID=TV.TableID and 
         T2.TableID=TV.ViewID and
         D.SessionID=@SessionID
   )
go


/**************************************************************/
/* Workload Analysis Report                                   */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_workload_analysis_report')
                  AND (type = 'IF')
                  AND (uid = USER_ID('dbo'))))
   DROP FUNCTION dbo.fn_DTA_workload_analysis_report
go


   CREATE FUNCTION dbo.fn_DTA_workload_analysis_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
	 'StatementType' = CASE 
                  WHEN StatementType = 0 THEN 'Select'
                  WHEN StatementType = 1 THEN 'Insert'
                  WHEN StatementType = 2 THEN 'Update'
                  WHEN StatementType = 3 THEN 'Delete'
                END,
	 'NumberOfQueries'=COUNT(QueryID),
         'NumberOfQueriesCostDecreased'=SUM(CASE
                  WHEN RecommendedCost<CurrentCost THEN 1 ELSE 0 END),
         'NumberOfQueriesCostIncreased'=SUM(CASE
                  WHEN RecommendedCost>CurrentCost THEN 1 ELSE 0 END),
         'NumberOfQueriesWithNoCostChange'=SUM(CASE
                  WHEN RecommendedCost=CurrentCost THEN 1 ELSE 0 END)
      from 
         DTA_reports_query
      where 
         SessionID=@SessionID group by StatementType
   )
go


/******************************************************************/
/* This script will be executed for only on Shiloh or earlier     */
/* version server                                                 */
/******************************************************************/

/***************************************************************/
/* Make sure we are int the right database                     */
/***************************************************************/
use msdb
go

/**************************************************************/
/* Creating Report functions                                  */
/*                                                            */
/**************************************************************/

/**************************************************************/
/* Query Cost Report                                          */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_query_cost_report')
                   AND (type = 'IF')))
   DROP FUNCTION fn_DTA_query_cost_report
go

   CREATE FUNCTION fn_DTA_query_cost_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
      (
      select 
         StatementString,
         'PercentImprovement'=100.0 * (CurrentCost - RecommendedCost)/CurrentCost
      from DTA_reports_query
      where SessionID=@SessionID
      )
go

/**************************************************************/
/* Event Frequency Report                                     */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_event_frequency_report')
                   AND (type = 'IF')))
   DROP FUNCTION fn_DTA_event_frequency_report
go


   CREATE FUNCTION fn_DTA_event_frequency_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
         EventString,
         EventFrequency 
      from DTA_reports_query
      where SessionID=@SessionID and EventFrequency>0
   )
go

/**************************************************************/
/* Query Detail Report                                        */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_query_detail_report')
                   AND (type = 'IF')))
   DROP FUNCTION fn_DTA_query_detail_report
go


   CREATE FUNCTION fn_DTA_query_detail_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
         QueryID,
         Type = CASE 
                  WHEN StatementType = 0 THEN 'Select'
                  WHEN StatementType = 1 THEN 'Insert'
                  WHEN StatementType = 2 THEN 'Update'
                  WHEN StatementType = 3 THEN 'Delete'
                END,
         CurrentCost,
         RecommendedCost,
         Frequency,
         StatementString
      from DTA_reports_query
      where SessionID=@SessionID
   )
go

/**************************************************************/
/* Query Index Relations Report                               */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_query_index_relations_report')
                   AND (type = 'IF')))
   DROP FUNCTION fn_DTA_query_index_relations_report
go


   CREATE FUNCTION fn_DTA_query_index_relations_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
         Q.StatementString,
         T.TableName,
         I.IndexName,
         I.IsClustered,
         I.IsUnique
      from 
         DTA_reports_query Q, 
         DTA_reports_queryindex QI, 
         DTA_reports_index I, 
         DTA_reports_table T
      where 
         Q.SessionID=QI.SessionID and 
         Q.QueryID=QI.QueryID and 
         QI.IndexID=I.IndexID and 
         I.TableID=T.TableID and 
         Q.SessionID=@SessionID
   )
go


/**************************************************************/
/* View Table Relations Report                                */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_view_table_relations_report')
                   AND (type = 'IF')))
   DROP FUNCTION fn_DTA_view_table_relations_report
go


   CREATE FUNCTION fn_DTA_view_table_relations_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
         'TableSchema'=T1.SchemaName,
         'TableName'=T1.TableName,
         'ViewSchema'=T2.SchemaName,
         'ViewName'=T2.TableName
      from 
         DTA_reports_database D, 
         DTA_reports_tableview TV, 
         DTA_reports_table T1,
	 DTA_reports_table T2
      where 
         D.DatabaseID=T1.DatabaseID and 
         D.DatabaseID=T2.DatabaseID and
         T1.TableID=TV.TableID and 
         T2.TableID=TV.ViewID and
         D.SessionID=@SessionID
   )
go


/**************************************************************/
/* Workload Analysis Report                                   */
/**************************************************************/
IF (EXISTS (SELECT *
                FROM msdb.dbo.sysobjects
                WHERE (name = N'fn_DTA_workload_analysis_report')
                   AND (type = 'IF')))
   DROP FUNCTION fn_DTA_workload_analysis_report
go


   CREATE FUNCTION fn_DTA_workload_analysis_report(@SessionID int)
   RETURNS TABLE
   AS
   RETURN
   (
      select 
	 'StatementType' = CASE 
                  WHEN StatementType = 0 THEN 'Select'
                  WHEN StatementType = 1 THEN 'Insert'
                  WHEN StatementType = 2 THEN 'Update'
                  WHEN StatementType = 3 THEN 'Delete'
                END,
	 'NumberOfQueries'=COUNT(QueryID),
         'NumberOfQueriesCostDecreased'=SUM(CASE
                  WHEN RecommendedCost<CurrentCost THEN 1 ELSE 0 END),
         'NumberOfQueriesCostIncreased'=SUM(CASE
                  WHEN RecommendedCost>CurrentCost THEN 1 ELSE 0 END),
         'NumberOfQueriesWithNoCostChange'=SUM(CASE
                  WHEN RecommendedCost=CurrentCost THEN 1 ELSE 0 END)
      from 
         DTA_reports_query
      where 
         SessionID=@SessionID group by StatementType
   )
go


<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema targetNamespace="http://schemas.microsoft.com/sqlserver/2004/07/dta" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/dta" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" blockDefault="#all">

<xsd:annotation>
	<xsd:documentation>
		The following schema for Microsoft SQL Server code name "Katmai" describes 
		input and output from the "database tuning advisor" tool in XML format.  

		Microsoft does not make any representation or warranty regarding the 
		schema or any product or item developed based on the schema. The schema 
		is provided to you on an AS IS basis.  Microsoft disclaims all express, 
		implied and statutory warranties, including but not limited to the implied 
		warranties of merchantability, fitness for a particular purpose, and freedom 
		from infringement. Without limiting the generality of the foregoing, 
		Microsoft does not make any warranty of any kind that any item developed 
		based on the schema, or any portion of the schema, will not infringe any 
		copyright, patent, trade secret, or other intellectual property right of any 
		person or entity in any country. It is your responsibility to seek licenses 
		for such intellectual property rights where appropriate.

		MICROSOFT SHALL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING OUT OF OR 
		IN CONNECTION WITH THE USE OF THE SCHEMA, INCLUDING WITHOUT LIMITATION, ANY 
		DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL (INCLUDING ANY LOST PROFITS), 
		PUNITIVE OR SPECIAL DAMAGES, WHETHER OR NOT MICROSOFT HAS BEEN ADVISED OF 
		SUCH DAMAGES. 
		(c) Microsoft Corporation. All rights reserved.
  
        </xsd:documentation>
	</xsd:annotation>
	
	<xsd:annotation>
		<xsd:appinfo>DTA XML Schema</xsd:appinfo>
		<xsd:documentation>
			XML Schema for DTA input/output 
		</xsd:documentation>
	</xsd:annotation>
	<!-- 
   **********************************************************************************
   **  
   **  This is the Root of the schema 
   **  hierarchy
   **  
   **
   **********************************************************************************
   -->
	<xsd:element name="DTAXML">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="DTAInput" type="DTAInputType" minOccurs="0" maxOccurs="1"/>
				<xsd:element name="DTAOutput" type="DTAOutputType" minOccurs="0" maxOccurs="1"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- 
   **********************************************************************************
   **  
   **  Root of Input schema hierarchy
   **  Input to DTA can be input arguments
   **  or an input user specified
   **  configuration.
   **
   **********************************************************************************
   -->
	<xsd:complexType name="DTAInputType">
		<xsd:sequence>
			<!--Server occurs once in the input-->
			<xsd:element name="Server" minOccurs="1" maxOccurs="1">
				<!--Server is a complexType.1 Name and multiple Databases under it-->
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
						<!--Database can occur multiple times.Should occur at lease once-->
						<xsd:element name="Database" minOccurs="1" maxOccurs="unbounded">
							<!--Database is a complexType.1 Name and 0 or more Schemas under -->
							<xsd:complexType>
								<xsd:sequence>
									<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
									<!--Schema can occur multiple times 0 or more schemas can occur. -->								
									<!--If no schema hierarchy is specified all objects under db is considered-->
									<xsd:element name="Schema" minOccurs="0" maxOccurs="unbounded">
										<xsd:complexType>
											<xsd:sequence>
												<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
												<xsd:choice minOccurs="1" maxOccurs="unbounded">
													<xsd:element name="Table" minOccurs="0" maxOccurs="1">
														<xsd:complexType>
															<xsd:sequence>
																<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
															</xsd:sequence>
															<xsd:attribute name="NumberOfRows" type="xsd:integer" use="optional" />
														</xsd:complexType>
													</xsd:element>													
													<xsd:element name="View" minOccurs="0" maxOccurs="1">
														<xsd:complexType>
															<xsd:sequence>
																<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
															</xsd:sequence>
														</xsd:complexType>
													</xsd:element>	
												<!--End of choice (Table/View)-->																									
												</xsd:choice>
											<!--End of Scheme sequence-->
											</xsd:sequence>
										<!--End of Schema complexType-->											
										</xsd:complexType>
									<!--End of Schema element-->										
									</xsd:element>	
								<!--End of Database sequence-->										
								</xsd:sequence>	
							<!--End of Database complexType-->										
							</xsd:complexType>		
						<!--End of Database element-->														
						</xsd:element>																			
					<!--End of Server sequence-->
					</xsd:sequence>
				<!--End of Server complexType-->					
				</xsd:complexType>
			<!--End of Server element-->				
			</xsd:element>
			<xsd:element name="Workload" type="WorkloadType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="TuningOptions" type="TuningOptionsType" minOccurs="0" maxOccurs="1"/>
			<xsd:element name="Configuration" type="ConfigurationType" minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Root of Output schema hierarchy
   **  Output of DTA includes Header (maps to
   **  what is currently generated in the 
   **  script file ),an o/p configuration	
   **  and Reports
   **
   **********************************************************************************
   -->
	<xsd:complexType name="DTAOutputType">
		<xsd:sequence>
			<xsd:element name="TuningSummary" type="TuningSummaryType" minOccurs="0" maxOccurs="1"/>
			<xsd:element name="Configuration" type="ConfigurationType" minOccurs="0" maxOccurs="1"/>
			<xsd:element name="AnalysisReport" type="AnalysisReportType" minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Use ServerDetailsType if specifying an object - Server.Database.Schema.Table
   **  Use ServerType if specifying a Configuration
   **
   **********************************************************************************
   -->
	<xsd:complexType name="ServerType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Database" type="DatabaseType" minOccurs="1" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  The Server/Database/Schema/Table hierarchy needs to be overloaded.
   **  This is because an index recommendation for instance cannot be associated
   **  with Database tag under DTAInput, whereas inside a USC this makes sense
   **  Use ServerDetailsType if specifying Server.Database.Schema.Table
   **  Use ServerType if specifying a USC
   **
   **********************************************************************************
   -->
	<xsd:complexType name="ServerDetailsType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Database" type="DatabaseDetailsType" minOccurs="1" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Database type - list of database 
   **  names
   **  Schema is Owner in Yukon
   **  Not to be confused with Schema in XML
   **  Partition functions and schemes operate
   **  at the database level
   **
   **********************************************************************************
   -->
	<xsd:complexType name="DatabaseType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:choice maxOccurs="unbounded">
				<xsd:element name="Recommendation" type="RecommendationPType" minOccurs="1" maxOccurs="1"/>
				<xsd:element name="Schema" type="SchemaType" minOccurs="1" maxOccurs="1" />
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Schema type - refers to owner in Yukon
   **  This preserves Server.DB.Owner.Object
   **  hierarchy
   **  
   **  This is equivalent to the notion of owner in SQL Server 2000   
   **
   **********************************************************************************
   -->
	<xsd:complexType name="SchemaType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:choice maxOccurs="unbounded">
				<xsd:element name="Recommendation" type="RecommendationViewType" minOccurs="1" maxOccurs="1"/>
				<xsd:element name="Table" type="TableType" minOccurs="1" maxOccurs="1"/>
				<xsd:element name="View" type="ViewType" minOccurs="1" maxOccurs="1" />
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	
	<!-- 
   **********************************************************************************
   **  
   **  Details of db.schema.table.This merely lists
   **  out the 3 part name of a table and attributes relevant for analysis
   **  reports
   **   
   **
   **********************************************************************************
    -->
	<xsd:complexType name ="DatabaseDetailsType">
		<xsd:sequence>
			<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Schema" minOccurs="1" maxOccurs="1">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
						<xsd:element name="Table" minOccurs="1" maxOccurs="1">
							<xsd:complexType>
								<xsd:sequence>
									<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
								</xsd:sequence>
							</xsd:complexType>
						</xsd:element>										
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>					
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  WorkloadFileType can be a workload file
   **  or a list of tables 
   **  
   **   
   **
   **********************************************************************************
    -->
	<xsd:complexType name="WorkloadType">
		<xsd:choice>
			<xsd:element name="File" type="xsd:string" minOccurs="1" maxOccurs="1"/>			
			<xsd:element name="Database" type="DatabaseDetailsType" minOccurs="1" maxOccurs="1"/>
			<xsd:sequence>
				<xsd:element name="EventString" minOccurs="1" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:simpleContent>
							<xsd:extension base="xsd:string">
								<xsd:attribute name ="Weight" use="optional" >
									<xsd:simpleType >
										<xsd:restriction base="xsd:float">
											<xsd:minExclusive value="0"/>
										</xsd:restriction>
									</xsd:simpleType>
								</xsd:attribute>
							</xsd:extension>
						</xsd:simpleContent>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>			
		<!--Workload from server cache-->
		<xsd:element name="ServerCache" minOccurs="1" maxOccurs="1"/>
		</xsd:choice>
	</xsd:complexType>
	
	

	<!-- 
   **********************************************************************************
   **  
   **  Format for Optional arguments 
   **  
   **
   **********************************************************************************
   -->
	<xsd:complexType name="TuningOptionsType">
		<xsd:sequence>
			<!--Report set maps to a choice of reports user would want to generate!-->
			<xsd:element name="ReportSet" minOccurs ="0" maxOccurs="1">
				<xsd:complexType>
					<xsd:sequence  minOccurs="0" maxOccurs="1">
						<xsd:element name="Report" minOccurs="1" maxOccurs="unbounded">
							<xsd:simpleType>
								<xsd:restriction base="xsd:string">
									<xsd:enumeration value="ALL" />
									<xsd:enumeration value="NONE" />		
									<xsd:enumeration value="STMT_COST" />
									<xsd:enumeration value="EVT_FREQ" />
									<xsd:enumeration value="STMT_DET" />
									<xsd:enumeration value="CUR_STMT_IDX" />
									<xsd:enumeration value="REC_STMT_IDX" />
									<xsd:enumeration value="STMT_COSTRANGE" />
									<!--Enumeration Removed-->
									<!--:enumeration value="REC_QRY_COSTRANGE" />-->
									<xsd:enumeration value="CUR_IDX_USAGE" />
									<xsd:enumeration value="REC_IDX_USAGE" />
									<xsd:enumeration value="CUR_IDX_DET" />
									<xsd:enumeration value="REC_IDX_DET" />
									<xsd:enumeration value="VIW_TAB" />
									<xsd:enumeration value="WKLD_ANL" />
									<xsd:enumeration value="DB_ACCESS" />
									<xsd:enumeration value="TAB_ACCESS" />
									<xsd:enumeration value="COL_ACCESS" />
								</xsd:restriction>				
							</xsd:simpleType>
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>	
     	<!--This is used to specify the table that DTA will use to output events that could not be tuned !-->
			<xsd:element name="TuningLogTable" minOccurs="0" maxOccurs="1">
				<xsd:complexType>
					<xsd:sequence minOccurs ="0" maxOccurs="1">
						<xsd:element name="Database" type="DatabaseDetailsType" minOccurs="1" maxOccurs="1"/>			
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<!--Number of events to be tuned!-->
			<xsd:element name="NumberOfEvents" type="xsd:unsignedInt" minOccurs="0" maxOccurs="1"/>
			<!--Specifies the tuning time in minutes, and is a required option unless NumberofEvents is specified!-->
			<xsd:element name="TuningTimeInMin" type="xsd:unsignedInt" minOccurs="0" maxOccurs="1"/>
                        <!-- If either of "NumberOfEvents" and "TuningTimeInMin" are absent, the other defaults to infinite.  -->
                        <!-- If both of "NumberOfEvents" and "TuningTimeInMin" are present, the earlier of the two events     -->
                        <!-- determines when tuning will terminate.                                                           -->

			<!--Specifies the maximum space in megabytes that can be consumed recommendation!-->
			<xsd:element name="StorageBoundInMB" type="xsd:unsignedInt" minOccurs="0" maxOccurs="1"/>
			<!--Specifies the maximum number of key columns in indexes proposed by DTA!-->
			<xsd:element name="MaxKeyColumnsInIndex" type="MaxKeyColumnsInIndexType" minOccurs="0" maxOccurs="1"/>
			<!--Specifies the maximum number of columns (key and non key) in indexes proposed by DTA!-->
			<xsd:element name="MaxColumnsInIndex" type="MaxColumnsInIndexType" minOccurs="0" maxOccurs="1"/>
			<!--Specifies the minimum improvement for DTA to propose a configuration!-->
			<xsd:element name="MinPercentageImprovement" type="xsd:int" minOccurs="0" maxOccurs="1"/>
			<!--Specifies the test server on which the tuning will be done!-->
			<xsd:element name="TestServer" type="xsd:string" minOccurs="0" maxOccurs="1"/>
			<xsd:choice>
				<xsd:element name="EvaluateConfiguration" minOccurs="1" maxOccurs="1"/>
				<!--Choose the feature set and partitioning options OR
				Choose to use drop only mode !-->
				<xsd:sequence>
					<xsd:choice>
						<xsd:sequence>
							<!--
									FeatureSet represents the class of physical design structures that will be considered
									by the tuning engine								
									IDX - Indexes
									IV - Index Views
									IDX_IV - Indexes and Index Views
									NCL_IDX - Non Clustered Indexes
								!-->
							<xsd:element name="FeatureSet" minOccurs="1" maxOccurs="1">
								<xsd:simpleType>
									<xsd:restriction base="xsd:string">
										<xsd:enumeration value="IDX" />
										<xsd:enumeration value="IV" />
										<xsd:enumeration value="IDX_IV" />
										<xsd:enumeration value="NCL_IDX" />
									</xsd:restriction>
								</xsd:simpleType>
							</xsd:element>
							<!--
								Partitioning represents the way the physical design structures considered will be partitioned
								by the tuning engine								
								NONE - No partitioning
								FULL - Full partitioning
								ALIGNED - Aligned partitioning
							!-->
							<xsd:element name="Partitioning" minOccurs="1" maxOccurs="1">
								<xsd:simpleType>
									<xsd:restriction base="xsd:string">
										<xsd:enumeration value="NONE" />
										<xsd:enumeration value="FULL" />
										<xsd:enumeration value="ALIGNED" />
									</xsd:restriction>
								</xsd:simpleType>
							</xsd:element>
						</xsd:sequence>
						<!--
							Suggest which physical design structures can be dropped.No new physical design structures are
							recommended in this mode, the physical design structures not used by the workload
							are suggested to be dropped.
						!-->
						<xsd:element name="DropOnlyMode" minOccurs="1" maxOccurs="1" />
					</xsd:choice>
					<!--
						KeepExisting refers to which existing physical design structures in 
						the database must be part of DTA recommendation
						NONE - Drop all
						ALL - Keep All
						CL_IDX - Keep Clustered Indexes
						ALIGNED - Keep Aligned
						IDX -Keep Indexes
					!-->
					<xsd:element name="KeepExisting" minOccurs="1" maxOccurs="1">
						<xsd:simpleType>
							<xsd:restriction base="xsd:string">
								<xsd:enumeration value="NONE" />
								<xsd:enumeration value="ALL" />
								<xsd:enumeration value="CL_IDX" />
								<xsd:enumeration value="ALIGNED" />
								<xsd:enumeration value="IDX" />
							</xsd:restriction>
						</xsd:simpleType>
					</xsd:element>
				</xsd:sequence>
			</xsd:choice>
      
      
      <xsd:element name="OnlineIndexOperation" minOccurs="0" maxOccurs="1">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:enumeration value="ON" />
						<xsd:enumeration value="OFF" />
						<xsd:enumeration value="MIXED" />			
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<!--Specifies the database to connect!-->
			<xsd:element name="DatabaseToConnect" type="xsd:string" minOccurs="0" maxOccurs="1"/>	
			<!--Ignore all constants in workload-->
			<xsd:element name="IgnoreConstantsInWorkload" minOccurs="0" maxOccurs="1"/>
			<!--Filtered Index Recommendations-->
			<xsd:element name="RecommendFilteredIndexes" minOccurs="0" maxOccurs="1"/>
			<!--Do not drop shell database-->
			<xsd:element name="RetainShellDB" minOccurs="0" maxOccurs="1"/>
			<!--Do not filter server cache entries-->
			<xsd:element name="DisableFilterByDatabaseId" minOccurs="0" maxOccurs="1"/>		
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **   Maximum number of key columns  
   **   1-16 range
   **   This only applies to Yukon Server
   **	
   **
   **********************************************************************************
   -->
	<xsd:simpleType name="MaxKeyColumnsInIndexType">
		<xsd:restriction base="xsd:unsignedInt">
			<xsd:minExclusive value="0" />
			<xsd:maxInclusive value="16" />
		</xsd:restriction>
	</xsd:simpleType>
	
   	<!-- 
   **********************************************************************************
   **  
   **   Maximum number of columns  
   **   The maxInclusive value applies only for  
   **   Yukon servers.For Pre-Yukon server(Shiloh/Sphinx)
   **	the upper bound will be implicitly 16
   **
   **********************************************************************************
   -->
	<xsd:simpleType name="MaxColumnsInIndexType">
		<xsd:restriction base="xsd:unsignedInt">
			<xsd:minExclusive value="0" />
			<xsd:maxInclusive value="1024" />
		</xsd:restriction>
	</xsd:simpleType>	


	<!--
   **********************************************************************************
   **  
   **  Summary of the work done by
   **  tuning engine
   **  
   **********************************************************************************
   -->
	<xsd:complexType name="TuningSummaryType">
		<xsd:sequence>
			<xsd:element name="ReportEntry" type="ReportEntryType" minOccurs="1" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
	<!--
   **********************************************************************************
   **  
   **  ReportEntryType is a Name/Value Pair
   **  
   **********************************************************************************
   -->
	<xsd:complexType name="ReportEntryType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Value" type="xsd:string" minOccurs="1" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>

	<!-- 
   **********************************************************************************
   **  
   **  ConfigurationType
   **  "ConfigurationType"  refers
   **  to an absolute or relative (delta)
   **  configuration. In the relative sense
   **  the configuration is a delta wrt to
   **  current configuration whereas 
   **  absolute refers to a stand alone
   **  absolute configuration 
   **  
   **
  **********************************************************************************
   -->
	<xsd:complexType name="ConfigurationType">
		<xsd:sequence minOccurs="0">
			<xsd:element name="Server" type="ServerType" minOccurs="1" maxOccurs="1"/>
		</xsd:sequence>
		<xsd:attribute name="SpecificationMode" type="SpecificationModeType" default="Relative" />
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Table type - list of table 
   **  names
   **   Schema in Yukon,refers to Table Owner Name
   **  
   **
   **********************************************************************************
   -->
	<xsd:complexType name="TableType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Recommendation" type="RecommendationType" minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>
	<!--
   **********************************************************************************
   **  View
   ** If there is a Recommendation node and
   ** no ViewDefinition node it  means the 
   ** Recommendation is on an existing view
   ** 
   **********************************************************************************
   -->
	<xsd:complexType name="ViewType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="ViewDefinition" minOccurs = "0" maxOccurs="1">
				<xsd:complexType>
					<xsd:simpleContent>
						<xsd:extension base = "xsd:string">
							<xsd:attribute name="QUOTED_IDENTIFIER" type ="xsd:boolean" use="optional"/>
							<xsd:attribute name="ARITHABORT" type ="xsd:boolean" use="optional"/>
							<xsd:attribute name="CONCAT_NULL_YIELDS_NULL" type ="xsd:boolean" use="optional"/>
							<xsd:attribute name="ANSI_NULLS" type ="xsd:boolean" use="optional"/>
							<xsd:attribute name="ANSI_PADDING" type ="xsd:boolean" use="optional"/>
							<xsd:attribute name="ANSI_WARNINGS" type ="xsd:boolean" use="optional"/>
							<xsd:attribute name="NUMERIC_ROUNDABORT" type ="xsd:boolean" use="optional"/>
						</xsd:extension>
					</xsd:simpleContent>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="Recommendation" type="RecommendationType" minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>
	<!--
   **********************************************************************************
   **  Recommendation Type
   **  Could be Create,Drop
   **********************************************************************************
   -->
	<xsd:complexType name="RecommendationType">
		<xsd:choice maxOccurs="unbounded">
			<xsd:element name="Create" type="CreateType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Drop" type="DropType" minOccurs="1" maxOccurs="1"/>
		</xsd:choice>
	</xsd:complexType>
	
	<!--
   **********************************************************************************
   **  Recommendation View  Type
   **  Only Create View Allowed
   **********************************************************************************
   -->
	<xsd:complexType name="RecommendationViewType">
		<xsd:sequence>
			<xsd:element name="Create" type="CreateViewType"  minOccurs="1" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	
	
	<!-- 
   **********************************************************************************
   **  CreateType
   ** <Create>
   **   <Index> | <View> |  <Statistics>
   **   <PartitionFunction> |
   **   <PartitionScheme>	
   ** </Create>
   **********************************************************************************
   -->
	<xsd:complexType name="CreateType">
		<xsd:choice>
			<xsd:element name="Index" type="IndexType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Statistics" type="StatisticsType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Heap" type="HeapType" minOccurs="1" maxOccurs="1"/>
		</xsd:choice>
	</xsd:complexType>
	
	
		<!-- 
   **********************************************************************************
   **  CreateViewype
   **********************************************************************************
   -->
	<xsd:complexType name="CreateViewType">
		<xsd:sequence>
			<xsd:element name="View" type="ViewType" minOccurs="1" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>
	
	<!-- 
   **********************************************************************************
   **  DropType
   **********************************************************************************
   -->
	<xsd:complexType name="DropType">
		<xsd:sequence>
			<xsd:choice>
				<xsd:element name="Index" type="IndexType" minOccurs="1" maxOccurs="1"/>
			</xsd:choice>	
		</xsd:sequence>
	</xsd:complexType>

	<!--
   **********************************************************************************
   **  Recommendation Type - FOR PARTITIONS
   **  Could be Create,Drop
   **********************************************************************************
   -->
	<xsd:complexType name="RecommendationPType">
		<xsd:choice maxOccurs="unbounded">
			<xsd:element name="Create" type="CreatePType" minOccurs="1" maxOccurs="1" />
		</xsd:choice>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  CreatePType
   ** 
   **********************************************************************************
   -->
	<xsd:complexType name="CreatePType">
		<xsd:choice>
			<xsd:element name="PartitionFunction" type="PartitionFunctionType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="PartitionScheme" type="PartitionSchemeType" minOccurs="1" maxOccurs="1"/>
		</xsd:choice>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  Index
   ** PartitionColumns - columns on which the
   ** table will be partitoned
   **********************************************************************************
   -->
	<xsd:complexType name="IndexType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" />
			<xsd:element name="Column" type="ColumnType" minOccurs="0" maxOccurs="1024" />
			<xsd:choice>
				<xsd:sequence>
					<xsd:element name="PartitionScheme" type="xsd:string" minOccurs="1" maxOccurs="1"/>
					<xsd:element name="PartitionColumn" type="ColumnType" minOccurs="1" maxOccurs="1024" />
				</xsd:sequence>
				<xsd:sequence>
					<xsd:element name="FileGroup" type="xsd:string" minOccurs="0" maxOccurs="1"/>
				</xsd:sequence>
			</xsd:choice>
			<xsd:element name="NumberOfReferences" type="xsd:double" minOccurs="0" maxOccurs="1" />
			<xsd:element name="PercentUsage" type="xsd:double" minOccurs="0" maxOccurs="1" />
			<xsd:element name="FilterDefinition" type="xsd:string" minOccurs="0" maxOccurs="1" />
		</xsd:sequence>
		<xsd:attribute name="Clustered" type="xsd:boolean" use="optional" default="false" />
		<xsd:attribute name="Unique" type="xsd:boolean" use="optional" default="false" />
		<xsd:attribute name="Online" type="xsd:boolean" use="optional" default="false" />
		<xsd:attribute name="FilteredIndex" type="xsd:boolean" use="optional" default="false" />
		<xsd:attribute name="IndexSizeInMB" type="xsd:double" />
		<xsd:attribute name="NumberOfRows" type="xsd:integer" />
		<xsd:attribute name="QUOTED_IDENTIFIER" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="ARITHABORT" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="CONCAT_NULL_YIELDS_NULL" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="ANSI_NULLS" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="ANSI_PADDING" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="ANSI_WARNINGS" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="NUMERIC_ROUNDABORT" type ="xsd:boolean" use="optional"/>
	</xsd:complexType>
	<!--	
   **********************************************************************************
   **  Statistics
   **********************************************************************************
   -->
	<xsd:complexType name="StatisticsType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:choice minOccurs ="0">
				<xsd:element name="FullScan" minOccurs="1" maxOccurs="1"/>
				<xsd:element name="SamplePercentage" type="xsd:unsignedInt" minOccurs="1" maxOccurs="1"/>
				<xsd:element name="SampleRows"  type="xsd:long" minOccurs="1" maxOccurs="1"/>	
			</xsd:choice>
			<xsd:element name="Column" type="ColumnType" minOccurs="1" maxOccurs="16" />
		</xsd:sequence>
		<xsd:attribute name="QUOTED_IDENTIFIER" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="ARITHABORT" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="CONCAT_NULL_YIELDS_NULL" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="ANSI_NULLS" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="ANSI_PADDING" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="ANSI_WARNINGS" type ="xsd:boolean" use="optional"/>
		<xsd:attribute name="NUMERIC_ROUNDABORT" type ="xsd:boolean" use="optional"/>
	</xsd:complexType>
	
	<!-- 
   **********************************************************************************
   **  Heap
   ** PartitionColumns - columns on which the table will be partitoned
   **********************************************************************************
   -->
	<xsd:complexType name="HeapType">
		<xsd:sequence>
			<xsd:choice>
				<xsd:sequence>
					<xsd:element name="PartitionScheme" type="xsd:string" minOccurs="1" maxOccurs="1"/>
					<xsd:element name="PartitionColumn" type="ColumnType" minOccurs="1" maxOccurs="1024" />
				</xsd:sequence>
				<xsd:sequence>
					<xsd:element name="FileGroup" type="xsd:string" minOccurs="0" maxOccurs="1"/>
				</xsd:sequence>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>	
	<!--	
   **********************************************************************************
   **
   **  PartitionFunctionType
   **
   **	
   **********************************************************************************
   -->
	<xsd:complexType name="PartitionFunctionType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" />
			<xsd:element name="ArgumentToFunction" type="xsd:string" minOccurs="1" maxOccurs="1024" />
			<xsd:element name="PartitionType" type="PartitionType" minOccurs="1" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>
	<!--	
   **********************************************************************************
   **
   **  PartitionType can be Range or Hash
   **
   **	
   **********************************************************************************
   -->
	<xsd:complexType name="PartitionType">
		<xsd:choice>
			<xsd:element name="Range" type="RangeType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="Hash" type="HashType" minOccurs="1"  maxOccurs="1"/>
		</xsd:choice>
	</xsd:complexType>
	<!--	
   **********************************************************************************
   **
   **  Range Type - Can have LEFT/RIGHT
   **  Boundary values . Unbounded as
   **  one can have as many partitions
   **  (as of now upper boundnot considered)
   **  values refer to range boundaries
   **  
   **	
   **********************************************************************************
   -->
	<xsd:complexType name="RangeType">
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element name="Value" minOccurs="1" maxOccurs="1" >
				<xsd:complexType>
					<xsd:simpleContent>
						<xsd:extension  base="xsd:string">
							<xsd:attribute name="IsNull" default="false" use="optional"/>
						</xsd:extension>
					</xsd:simpleContent>			
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="Boundary" use="optional">
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:enumeration value="Left" />
					<xsd:enumeration value="Right" />
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:attribute>
	</xsd:complexType>
	<!--	
   **********************************************************************************
   **
   **  Hash type
   **  Value here refers to Number of Partitions
   **
   **	
   **********************************************************************************
   -->
	<xsd:complexType name="HashType">
		<xsd:sequence>
			<xsd:element name="NumberOfPartitions" type="xsd:unsignedInt" minOccurs="1" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:complexType>
	<!--	
   **********************************************************************************
   **  PartitionSchemeType
   **********************************************************************************
   -->
	<xsd:complexType name="PartitionSchemeType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="PartitionFunction" type="xsd:string" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="FileGroup" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  Column
   **********************************************************************************
   -->
	<xsd:complexType name="ColumnType">
		<xsd:sequence>
			<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
		</xsd:sequence>
		<xsd:attribute name="Type" type="ColType" use="optional" />
		<xsd:attribute name="SortOrder" type="SortOrderType" default="Ascending" use="optional"/>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  AnalysisReport
   **  Note about Tuning Summary report:
   **  This is generated from the schema of the 
   **  <HEADERTYPE> </HEADERTYPE> subtree. 	
   **  
   **
   **********************************************************************************
   -->
	<xsd:complexType name="AnalysisReportType">
		<xsd:choice minOccurs="0" maxOccurs="unbounded">
			<xsd:element name="StatementCostReport" type="StatementCostReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="EventWeightReport" type="EventWeightReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="StatementDetailReport" type="StatementDetailReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="StatementIndexReport" type="StatementIndexReportType" minOccurs="1"  maxOccurs="1"/>
			<xsd:element name="StatementCostRangeReport" type="StatementCostRangeReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="IndexUsageReport" type="IndexUsageReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="IndexDetailReport" type="IndexDetailReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="ViewTableReport" type="ViewTableReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="WorkloadAnalysisReport" type="WorkloadAnalysisReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="DatabaseAccessReport" type="DatabaseAccessReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="TableAccessReport" type="TableAcessReportType" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="ColumnAccessReport" type="ColumnAcessReportType" minOccurs="1" maxOccurs="1"/>
		</xsd:choice>
	</xsd:complexType>
	
	<!-- 
   **********************************************************************************
   **  
   ** Hierarchy for Analysis reports. Number of differences are more than the other
   ** 2 nodes - hence extension / restrict is not used
   ** This is a very open schema hierarchy
   **
   **********************************************************************************
   -->
	<xsd:complexType name ="ReportsDatabaseHierarchyType">
		<xsd:sequence>
			<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
			<xsd:element name="NumberOfReferences"  type="xsd:double" minOccurs="0" maxOccurs="1"/>
			<xsd:element name="PercentUsage" type="xsd:double" minOccurs="0" maxOccurs="1"/>
			<!--Schema is optional.Database usage report doesnt need rest of the hierarchy-->
			<xsd:element name="Schema" minOccurs="0" maxOccurs="unbounded">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
						<!--Choice of Table or View.maxOccurs=1 minOccurs=1 since at least 1 reqd-->
						<!--View tag is part of the ViewTable report-->
						<xsd:choice>
							<!--Table Usage Report/ Index Detail/Index Usage/Column Usage/Statement Index Report-->
							<!--follow the hierarchy below table-->
							<xsd:element name="Table" minOccurs="0" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:sequence>
										<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
										<xsd:element name="NumberOfReferences"  type="xsd:double" minOccurs="0" maxOccurs="1"/>
										<xsd:element name="PercentUsage" type="xsd:double" minOccurs="0" maxOccurs="1"/>			
										<!--Can be Index/Column or No element.Index if Index Usage /Detail report-->
										<!--Column if column access report. For Table usage report choice doesnt occur-->
										<xsd:choice minOccurs="0">
											<xsd:sequence>
												<!--Index sequence should contain Index tag.So minOccurs=1-->
												<xsd:element name="Index" minOccurs="1" maxOccurs="unbounded">
												<xsd:complexType>
													<xsd:sequence>
														<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
														<xsd:element name="NumberOfReferences"  type="xsd:double" minOccurs="0" maxOccurs="1"/>
														<xsd:element name="PercentUsage" type="xsd:double" minOccurs="0" maxOccurs="1"/>			
													</xsd:sequence>
													<xsd:attribute name="Clustered" type="xsd:boolean" use="optional" default="false" />
													<xsd:attribute name="Unique" type="xsd:boolean" use="optional" default="false" />
													<xsd:attribute name="Online" type="xsd:boolean" use="optional" default="false" />
													<xsd:attribute name="Heap" type="xsd:boolean" use="optional" default="false" />											
													<xsd:attribute name="FilteredIndex" type="xsd:boolean" use="optional" default="false" />											
													<xsd:attribute name="IndexSizeInMB" type="xsd:double" />
													<xsd:attribute name="NumberOfRows" type="xsd:integer" />								
													<xsd:attribute name="FilterDefinition" type="xsd:string" use="optional" default="false" />											
												</xsd:complexType>
											</xsd:element>
											</xsd:sequence>	
											<xsd:sequence>	
												<!--Column sequence should contain Column tag.So minOccurs=1-->														
												<xsd:element name="Column" minOccurs="1" maxOccurs="unbounded">
												<xsd:complexType>
													<xsd:sequence>
														<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
														<xsd:element name="NumberOfReferences"  type="xsd:double" minOccurs="0" maxOccurs="1"/>
														<xsd:element name="PercentUsage" type="xsd:double" minOccurs="0" maxOccurs="1"/>			
													</xsd:sequence>
												</xsd:complexType>
											</xsd:element>
											</xsd:sequence>	
										</xsd:choice>									
									</xsd:sequence>
								</xsd:complexType>
							</xsd:element>										
							<!--For View Table Report-->
							<xsd:element name="View" minOccurs="0" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:sequence>
										<xsd:element name="Name" minOccurs="1" maxOccurs="1"/>
										<!--At least one Table under View Table Report-->
										<xsd:element name="Table" minOccurs="1" maxOccurs="unbounded">			
											<xsd:complexType>
												<xsd:sequence>
													<xsd:element  name="Name" minOccurs="1" maxOccurs="1" />										
												</xsd:sequence>
										</xsd:complexType>
										</xsd:element>
									</xsd:sequence>
								</xsd:complexType>
							</xsd:element>
						<!--End choice of table or view-->
						</xsd:choice>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:sequence>					
	</xsd:complexType>

	<!-- 
   **********************************************************************************
   **  
   **  Statement Cost Report contains StatementType
   **  
   **
   **********************************************************************************
   -->
	<xsd:complexType name="StatementCostReportType">
		<xsd:sequence>
			<xsd:element name="Statement"  type="StatementType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="StatementType">
		<xsd:sequence>
			<xsd:element name="StatementID" type="xsd:integer" />
			<xsd:element name="StatementString" type="xsd:string" minOccurs="1" maxOccurs="1" />
			<xsd:element name="PercentImprovement" type="xsd:double" minOccurs="0" maxOccurs="1" />
			<xsd:element name="Type" type="xsd:string" minOccurs="1" maxOccurs="1" />
			<xsd:element name="CurrentCost" type="xsd:string" minOccurs="0" maxOccurs="1" />
			<xsd:element name="RecommendedCost" type="xsd:string" minOccurs="0" maxOccurs="1" />
			<xsd:element name="EventString" type="xsd:string" minOccurs="0" maxOccurs="1" />
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Event Frequency Report 
   **  
   **
   **********************************************************************************
   -->
   	<xsd:complexType name="EventWeightReportType">
		<xsd:sequence>
			<xsd:element name="EventDetails" type="EventDetailsType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="EventDetailsType">
		<xsd:sequence>
			<xsd:element name="EventString" type="xsd:string" minOccurs="1" maxOccurs="1" />
			<xsd:element name="Weight" type="xsd:double" minOccurs="1" maxOccurs="1" />
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Statement Detail Report 
   **  
   **
   **********************************************************************************
   -->
	<xsd:complexType name="StatementDetailReportType">
		<xsd:sequence>
			<xsd:element name="Statement"  type="StatementType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Statement Index Relations Report - 2 reports
   **  
   **********************************************************************************
   -->
	<xsd:complexType name="StatementIndexReportType">
		<xsd:sequence>
			<xsd:element name="StatementIndexDetail"  type="StatementIndexDetailType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
		<xsd:attribute name="Current" type="xsd:boolean" use="optional" />
	</xsd:complexType>
	

	<xsd:complexType name="StatementIndexDetailType">
		<xsd:sequence>
			<xsd:element name="StatementString" type="xsd:string" minOccurs="0" maxOccurs="1" />
			<!--Multiple dbs-->
			<xsd:element name="Database" type="ReportsDatabaseHierarchyType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>	
	
	<!-- 
   **********************************************************************************
   **  
   **  Statement Cost Range Report 
   **
   **********************************************************************************
   -->
	<xsd:complexType name="StatementCostRangeReportType">
		<xsd:sequence>
			<xsd:element name="CostRange"  type="CostRangeType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="CostRangeType">
		<xsd:sequence>
			<xsd:element name="NumStatementsCurrent" type="xsd:integer" minOccurs="1" maxOccurs="1" />
			<xsd:element name="NumStatementsRecommended" type="xsd:integer" minOccurs="1" maxOccurs="1" />
		</xsd:sequence>
		<xsd:attribute name="Percent" type="xsd:string" use="optional" />
	</xsd:complexType>		
	<!-- 
   **********************************************************************************
   **  
   **  Index Usage Report
   **    
   **********************************************************************************
   -->
	<xsd:complexType name="IndexUsageReportType">
		<xsd:sequence>
			<xsd:element name="Database"  type="ReportsDatabaseHierarchyType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
		<xsd:attribute name="Current" type="xsd:boolean" use="optional" />
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Index Detail Report 
   **  
   **
   **********************************************************************************
   -->
	<xsd:complexType name="IndexDetailReportType">
		<xsd:sequence>
			<xsd:element name="Database"  type="ReportsDatabaseHierarchyType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
		<xsd:attribute name="Current" type="xsd:boolean" use="optional" />
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  View Table Relations Record
   **  
   **
   **********************************************************************************
   -->
	<xsd:complexType name="ViewTableReportType">
		<xsd:sequence>
			<xsd:element name="Database"  type="ReportsDatabaseHierarchyType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>			
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Workload Analysis Report
   **  
   ** 
   **********************************************************************************
   -->
	<xsd:complexType name="WorkloadAnalysisReportType">
		<xsd:sequence>
			<xsd:element name="Statements"  type="StatementsType" minOccurs="0" maxOccurs="4" />	
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="StatementsType">
		<xsd:sequence>
			<xsd:element name="Type" type="xsd:string"/>
			<xsd:element name="NumberOfStatements" type="xsd:integer"/>
			<xsd:element name="CostDecreased" type="xsd:integer"/>
			<xsd:element name="CostIncreased" type="xsd:integer" />
			<xsd:element name="CostSame" type="xsd:integer"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- 
   **********************************************************************************
   **  
   **  Database Access Report 
   **  
   **
   **********************************************************************************
   -->
   	<xsd:complexType name="DatabaseAccessReportType">
		<xsd:sequence>
			<xsd:element name="Database"  type="ReportsDatabaseHierarchyType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>

	<!-- 
   **********************************************************************************
   **  
   **  Table Access Report 
   **  
   **
   **********************************************************************************
   -->
    <xsd:complexType name="TableAcessReportType">
		<xsd:sequence>
			<xsd:element name="Database"  type="ReportsDatabaseHierarchyType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>

	<!-- 
   **********************************************************************************
   **  
   **  Column Access Report 
   **  
   **
   **********************************************************************************
   -->
      <xsd:complexType name="ColumnAcessReportType">
		<xsd:sequence>
			<xsd:element name="Database"  type="ReportsDatabaseHierarchyType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>

	<!--
**********************************************************************************
**  
**  Simple Types
**
**
**
**********************************************************************************
-->
	<xsd:simpleType name="SortOrderType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="Ascending" />
			<xsd:enumeration value="Descending" />
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="SpecificationModeType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="Relative" />
			<xsd:pattern value="Absolute" />
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="ColType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="KeyColumn" />
			<xsd:enumeration value="IncludedColumn" />
		</xsd:restriction>
	</xsd:simpleType>

</xsd:schema>
BSJBv4.0.30319lh#~ԓ؂#StringsPH#US^#GUID_0;#BlobW_	%3j</k
:u
*=IU_dv
		

,	6cP!,P

	`

	

&f&&f&Jf&-f&f&f&(=5=Y=A@RAf&<f&
B	B@BBBBSSVf&If&9Wf&f&XX2xYX[[]eveSgveggXgXgXgXgXgXhX)hXDhX_hXvhXhXhXhShiiX8iPCLi[i{i
i	iX"4j
jQj^j
&xj
jjj
&,j
j
>kjikokk
kPkP!lPDl*l{lll.2mm.:mm.Rmm.zmmm
.mm&
m
m
m
m
m
	njWndnunnnnnnnnn"o
j$on6oMovecovenoojo
o
oApnepYp}psppsp
p	ppq
Bq	cqsp
q	
q
q
q	
qrsp!rsp
1r	r
r	
r	sYp.ssp;sspTssp
ds	
~s	ssjszmt,tf&tf&tttuV262Y=uuuu.vm4v
&m
Vv
.vmv[f&f&'wf&^0f&f&Vwf&
{w	wwwwf&wf&<xf&}xf&xf&xf&xf&x
yf&!yf&f&f&Fyf&hyf&yyy3zLzazzzzz6{z{z!{z'{z9{zT{zf{z{f&2B@=|@Y|||Xf&wf&|@}f&~@@~+~K~+~T~[~a~2}f~s~~~X~X~~X~X~X":rWnnnsplXрve`X3]33
3
3	3@3B3G3G3H3J3K3K$38L23
mJ38nX3Dy*c3
}5x3~;3D~?3
V38\3
383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2Y2Y2qv2<<
#WW22is2~2
#~2x2~2x
353s:3'@3+y3F3lP3GnV3rn3	x33!)3-'sJ4>J!K$WZ4Nn`	d2Z4x44JQBu4AJJ	J]TJ|14Aǀ>rA5IQY>`SK53ac*kR5'JGni5q'hk/h	]a*5qԁJ\[\8<@Du z(,48<DHLPX\`hlpt|uuzu$`.	dS	h	l	p
ta
x
|


8>k

#Dq#2]1xH(S $(?,048<@'DVHLP\6`Udrh{lptx|,7FQds
D}$5Nex|			lptx|       )!)!D!!!!!"	"	"*"I""#.9.KG6.:.;.;.[&.&.+5.35.;5.C6.s&.SY6.{&.c6.k&.&.&.6.K8.6####i&=&&&"&+&&=&R&&"&&#	d&	=&	&)&I=&I&I&Iq&c#i&&#&&&=&&#C#I&i&#&&#&&	&)&I&i&&&&&	&)=&)&)"&)*)&I&I+I+i&&&&)+=&&3+&+	&)&I&i&&&	#	c	#	##
k2cC
A=:43###J$^$$$%S%~%%%%%&&&&&&&G'h'z''''S(j(((((( ):)J)^)p))))*w******?+L+`+++++++,M,y,,,,,,,,O-----.0.;.B.G.K._.h.~..../*/>/O/T/`/m///////////0)0r0~0000000011(1-1J1i111111*222222223/3\3Y333T4c4p4~4444455#5,535X5]5c5o5v555555	JN_

!r!rY=uYYY
Y Y!Y"Y**Y**Y**Yr.Yu/Y**Y**Y**Y!r
	
68:LN\adkn !#')8:@ADEFGH	I(J)K6L9M<N=OHQKRPSRTTUUWWYY_Z`]cadeeihmiu	~			~		~|


JQUVdp}[~	~~~~a	~0~Jd&>S~l~~<CFS~Y	~nu~&|	~~&&&&&''.'5'J'P'c'|
t''

)&	~~C)~&&'#)9)P)X)|
)-)1)1&&&
R
Xt+~			+&&

^0	~d0p0)-y0-0~00~~C0000			+&01


^0	~C1C1			+&0I
a
g	~11
	~
&|22~7	~&~~	~&|d:ao::g::m::::;s,;?;W;b;r;;;;;~Xy;;;<<;<~M<f<<<<=>=:>~l~u=:~[@=:n@&|)@~@B&|<LL*	L*	L*	L*	L*	L*	M*	5M*	SM*	qM*	M*	M*	M*	-N*	aN*	N*	N*	N*	O*	AO*	zO*	O*	O*	P*	=P*	hP*	P*	P*	P*	.Q*	cQ*	Q*	Q*	Q*	Q*	R*	ER*	R*	R*	R*	R*	S*	4S*	LS*	jS*	S*	S*	S*	LLU*	U*		*	n*	C*	F*	*	*	p*	}*	*	U*	U*	V*	G>*	M>*	W>*	_>*	i>*	r>*	{>*	?*	?*	?*	?*	?*	?*	
V*	V*	"V*	L&	~VVV		'	&+W&

W	9W~WW	&	~I~		'	&+X&
Q
X@~/Y~9YAYNYAYNYAYNYNYAYNYAYNYZ9]HH]W]~]]X]^]]]X]^]]]X]^]]]X]^]l_{_______b*	014367:9	O
N
QP
UT^_`abc!  "!""$#=$>$%%T&S&&'((')**(+)+,,+-..-/!0 0D1C1N2M2E3F344J566K7S9R9Z;[=\?]AdCqE{G|I}K~MOQSSUWYY[[]_acegiikkmmoqqsuwy{}}	 !"&'(,-./01369:A@CBEDFGHJIKWZ[]^_`acbdefgihkjmlnoprqstuvwxy{z|}~	
!!##%')+-/135799;;==??ACEGIIKMMOQQSUUWWYY[[]]_a	a
cee
giikmmooqssuwwy{{}} "!#$&%34567=>?EFGHNcdefh	
!#%')+-/13579;=?ACEGIKMOQQSUU	WW
Y[[
]__aaceegii#k&m(o)q+s,u-w2y5{7}6}89:<;>=?@ABDCPSVWY[Z]^_hinotwxv1
'.5&))D+F,0I01`44)5CZEZ"#i	

},j
${lm;&^.pʂIHZY\[][^[1kZ%%%%&&&&04050505<Module>DTAClient.dllUnrecognizedRecommendationMicrosoft.SqlServer.Management.DTA.ClientUnrecognizedRecommendationCollectionSchemaSchemaDictionaryTuningServerIdComparerNameValuePairTuningSessionTuningSessionCollectionConnectionTrackerRecommendationComparerILifeStateLifeStateInputDatabaseInputDatabaseDictionaryTableViewBaseInputTableInputTableDictionaryIGetScriptViewViewDictionaryIndexIndexDictionaryStatisticStatisticDictionaryIndexColumnColumnCollectionStatisticColumnStatisticColumnCollectionWorkloadTypeInputWorkloadTableBaseWorkloadTableInputTuningOptionsErrorTableDtaClientConstantsTuningProgressingEventHandlerTuningProgressingEventArgsReportingProgressingEventHandlerReportingProgressingEventArgsTuningDoneEventHandlerSessionStatusFinishStatusRecommendationTypeStatisticScanTypeOnlineRecommendationOptionsTuningFeatureSetTuningPartitioningStrategyTuningKeepExistingStructuresTuningStageReportFormatReportTypeServerEditionSessionConstantsTuningDoneEventArgsSessionAddedEventHandlerSessionEventArgsSessionAddedEventArgsSessionDeletedEventHandlerSessionDeletedEventArgsConnectionOpenedEventHandlerConnectionClosedEventHandlerRecommendationScriptItemDtaClientUtilsStringComparerDtaExceptionSessionProgressMonitorExceptionServerStatusMonitorExceptionExceptionTextResSRKeysPartitionFunctionPartitionFunctionCollectionPartitionFunctionParameterPartitionFunctionParameterCollectionPartitionSchemePartitionSchemeCollectionArgumentExpectsValueMicrosoft.SqlServer.Management.DTA.UtilitiesArgumentAttributeFlagArgumentAttributeValueArgumentAttributeOptionalValueArgumentAttributeValueListArgumentAttributeFileNameArgumentAttributeOptionalFileNameArgumentAttributeParserExceptionCommandLineParserArgumentMemberInfoSafeNativeMethodsCOORDSMALL_RECTCONSOLE_SCREEN_BUFFER_INFOTuningConnectionIQueryQueryCallbackQueryMethodAsyncQuerySyncQueryCommandQueryNonQueryReaderQuerySetOptionsAssemblyVersionInfomscorlibSystemObjectSystem.Collections.GenericList`1System.CollectionsSortedListMarshalByRefObjectIDisposableIComparer`1ValueTypeEnumMulticastDelegateEventArgsIComparerApplicationExceptionAttribute.ctornameget_NamerecommendationTypeget_RecommendationrecommendationIndexget_RecommendationIndexset_RecommendationIndexxmlget_XmlisSelectedForInputConfigurationget_IsSelectedForInputConfigurationset_IsSelectedForInputConfigurationSystem.XmlXmlTextWriterGenerateConfigurationXmlNameRecommendationRecommendationIndexXmlIsSelectedForInputConfigurationAddunrecognizedRecommendationsget_UnrecognizedRecommendationsRefreshUnrecognizedRecommendationsUnrecognizedRecommendationsdatabaseget_ItemItemMicrosoft.SqlServer.ConnectionInfoMicrosoft.SqlServer.Management.CommonSqlConnectionInfoSystem.DataSystem.Data.SqlClientSqlConnectionconnectionInitializedInitializeConnectionsqlConnectionget_ConnectionconnInfoget_ConnectionInfoConnectDisconnectget_IsConnectedDisposemajorVersionget_MajorVersionminorVersionget_MinorVersionPopulateServerVersionserverEditionget_Editionget_EditionNamePopulateServerEditionget_UserNameget_Passwordget_UseIntegratedSecurityinitializedTuningParametersDatabaseget_IsTuningParametersDatabaseInitializedset_IsTuningParametersDatabaseInitializedInitializeTuningParametersDatabasecollationget_CollationPopulateCollationsessionListget_TuningSessionsQuerySessionsRefreshTuningSessionsSessionAddedadd_SessionAddedremove_SessionAddedOnSessionAddedSessionDeletedadd_SessionDeletedremove_SessionDeletedOnSessionDeletedConnectionOpenedadd_ConnectionOpenedremove_ConnectionOpenedOnConnectionOpenedConnectionClosedadd_ConnectionClosedremove_ConnectionClosedOnConnectionClosedStartSessionsStatusMonitorStopSessionsStatusMonitorSystem.ThreadingThreadstatusThreadManualResetEventmonitorStatusMonitorStatusConnectionConnectionInfoIsConnectedMajorVersionMinorVersionEditionEditionNameUserNamePasswordUseIntegratedSecurityIsTuningParametersDatabaseInitializedCollationTuningSessionsCompareset_Namevalueget_Valueset_ValueValueDateTimetuningConnectionSystem.DiagnosticsProcesstuningProcessprogressThreadExceptiontuningProgressExceptionget_TuningProgressExceptionset_TuningProgressExceptionEventHandlerTuningProgressExceptionOccuredadd_TuningProgressExceptionOccuredremove_TuningProgressExceptionOccuredStartAttachDetachestimatedImprovementget_EstimatedImprovementconsumingWorkloadMessageget_ConsumingWorkloadMessageperformingAnalysisMessageget_PerformingAnalysisMessagegeneratingReportsMessageget_GeneratingReportsMessageTuningProgressadd_TuningProgressremove_TuningProgressReportingProgressadd_ReportingProgressremove_ReportingProgressTuningDoneadd_TuningDoneremove_TuningDonemonitorProgressget_IsAttachedSystem.Runtime.CompilerServicesIsVolatileTraceSwitchSessionProgressMonitorMonitorProgressStoreSessionXmlDeleteSessionXmlGenerateSessionXmlRefreshConsumeSessionXmlSystem.Xml.SchemaValidationEventArgsOnInvalidSessionXmlXmlNodeConsumeInputXmlGetNextRecommendationIndexrecommendationsLoadedGetRecommendationsget_AreRecommendationsLoadedArrayListsummaryReportGetSummaryReportIDataReaderGetReportAsRowsetXmlReaderGetReportAsXmlGetOutputXmlSaveOuputXmlDataSetGetTuningErrorsGetTuningErrorsForXmlhasTuningProgressEventsget_HasTuningProgressEventscompletedWorkloadParsingget_CompletedWorkloadParsinghasReportProgressEventsget_HasReportProgressEventscompletedReportsget_CompletedReportshasInputConfigurationSelectionget_HasInputConfigurationSelectionConsumeRecommendationsXmlOnInvalidRecommendationXmlConsumeTuningSummaryXmlConsumeConfigurationXmlrecommendationsListrecommendationsIncludeDatabaseContextSystem.Collections.SpecializedStringCollectionGenerateRecommendationsScriptGenerateRecommendationsListServerConnectionscheduledRecommendationsTimescheduledRecommendationsJobNameScheduleRecommendationsMicrosoft.SqlServer.SmoMicrosoft.SqlServer.Management.Smo.AgentJobServerGenerateUniqueJobNametuningServerget_ServersessionIdget_IDset_IDcreationTimeget_CreationTimetuningErrorget_ErrorconsoleModeEnabledget_IsConsoleModeEnabledset_IsConsoleModeEnabledNameChangedadd_NameChangedremove_NameChangedsessionNameStatusChangedadd_StatusChangedremove_StatusChangedsessionStatusget_Statusget_StatusNameUpdateSessionStatusCancelStopRenameSessionSetSessionStatusget_DatabasesGetDatabasesAsyncQueryDatabasesQueryDatabasesCallbackQueryDatabasesFinishedadd_QueryDatabasesFinishedremove_QueryDatabasesFinishedOnQueryDatabasesFinishedDatabaseAddedadd_DatabaseAddedremove_DatabaseAddedOnDatabaseAddedget_QueryDatabaseLastErrorinputDatabasesqueryDatabasesqueryDatabasesLastErrorqueryDatabasesSyncRootReleaseDatabasesinputWorkloadget_WorkloadinputTuningOptionsget_TuningOptionsaddRecommendationsSelectedForDisplayget_AreAddRecommendationsSelectedForDisplayset_AreAddRecommendationsSelectedForDisplaydropRecommendationsSelectedForDisplayget_AreDropRecommendationsSelectedForDisplayset_AreDropRecommendationsSelectedForDisplayOnNameChangedOnStatusChangedTuningProgressExceptionEstimatedImprovementConsumingWorkloadMessagePerformingAnalysisMessageGeneratingReportsMessageIsAttachedAreRecommendationsLoadedHasTuningProgressEventsCompletedWorkloadParsingHasReportProgressEventsCompletedReportsHasInputConfigurationSelectionServerIDCreationTimeErrorIsConsoleModeEnabledStatusStatusNameDatabasesQueryDatabaseLastErrorWorkloadTuningOptionsAreAddRecommendationsSelectedForDisplayAreDropRecommendationsSelectedForDisplayGetByIDRemoveSystem.IDisposable.DisposeopenedConnectionsessionDefaultget_IsExistingset_IsExistingget_IsValidStateIsExistingIsValidStateexistingFlagtuningSessionget_SessiondatabaseNamecompatibilityLevelget_CompatibilityLevelFetchAllPropertiesAsyncfetchAllTableDataget_FetchAllTableDataset_FetchAllTableDataselectedget_IsSelectedset_IsSelectedselectedForDisplayget_IsSelectedForDisplayset_IsSelectedForDisplayget_HasInputConfigurationSelectionsQueryPropertiesQueryPropertiesCallbackarePropertiesPopulatedget_ArePropertiesPopulatedqueryPropertiesqueryPropertiesSyncRootget_NumberOfTablesGetNumberOfTablesAsyncQueryNumberOfTablesQueryNumberOfTablesCallbackQueryNumberOfTablesFinishedadd_QueryNumberOfTablesFinishedremove_QueryNumberOfTablesFinishedOnQueryNumberOfTablesFinishednumberOfTablesqueryNumberOfTablesqueryNumberOfTablesSyncRootget_TablesGetTablesAsyncQueryTablesQueryTablesCallbackQueryTablesFinishedadd_QueryTablesFinishedremove_QueryTablesFinishedOnQueryTablesFinishedTableAddedadd_TableAddedremove_TableAddedOnTableAddedget_QueryTablesLastErrortablesqueryTablesqueryTablesSyncRootqueryTablesLastErrorviewsget_ViewsQueryViewsRefreshViewsQueryRefreshViewstableIndexesPopulatedviewIndexesPopulatedtableStatisticsPopulatedviewStatisticsPopulatedPopulateIndexesStatisticsQueryTableIndexesQueryViewIndexesQueryTableStatisticsQueryViewStatisticsQueryIndexesStatisticsRefreshIndexesQueryRefreshTableIndexesQueryRefreshViewIndexesQueryRefreshTableStatisticsQueryRefreshViewStatisticsQueryRefreshIndexesStatisticspartitionFunctionsget_PartitionFunctionsQueryPartitionFunctionsRefreshPartitionFunctionsQueryRefreshPartitionFunctionsget_PartitionSchemesGetPartitionSchemesAsyncQueryPartitionSchemesQueryPartitionSchemesCallbackpartitionSchemesqueryPartitionSchemesqueryPartitionSchemesSyncRootqueryPartitionSchemesLastErrorRefreshPartitionSchemesQueryRefreshPartitionSchemesunrecognizedRecommendationSchemasget_UnrecognizedRecommendationSchemasRefreshUnrecognizedRecommendationSchemasgeneratingInputXmlGenerateInputXmlget_HasRecommendationsMicrosoft.SqlServer.Management.SmoDatabaseScripterSessionCompatibilityLevelFetchAllTableDataIsSelectedIsSelectedForDisplayHasInputConfigurationSelectionsArePropertiesPopulatedNumberOfTablesTablesQueryTablesLastErrorViewsPartitionFunctionsPartitionSchemesUnrecognizedRecommendationSchemasHasRecommendationsviewFlagget_IsViewinputDatabaseget_Databaseset_DatabasetableNameschemaNameget_Schemaset_SchemaobjectIdget_SchemaQualifiedNameset_SchemaQualifiedNameaddRecommendationsget_HasAddRecommendationsset_HasAddRecommendationsdropRecommendationsget_HasDropRecommendationsset_HasDropRecommendationsindexesget_Indexesstatisticsget_StatisticsIsViewSchemaQualifiedNameHasAddRecommendationsHasDropRecommendationsIndexesStatisticssizeget_SizeactualTableRowsget_ActualRowsprojectedTableRowsget_ProjectedRowsset_ProjectedRowsSizeActualRowsProjectedRowsScriptGetScriptAsyncadd_GetScriptFinishedremove_GetScriptFinishedGetScriptFinishedviewDefinitionget_ViewDefinitionset_ViewDefinitionrecommendationset_RecommendationselectedForInputConfigurationselectedForScriptingget_IsSelectedForScriptingset_IsSelectedForScriptingsetOptionsConsumeSetOptionsQueryScriptQueryScriptCallbackOnGetScriptFinishedscriptqueryScriptqueryScriptSyncRootViewDefinitionIsSelectedForScriptinginputTableget_TableindexNameclusteredget_IsClusteredset_IsClustereduniqueget_IsUniqueset_IsUniqueget_SizeValuefileGroupget_FileGroupset_FileGroupfilteredIndexget_IsFilteredIndexset_IsFilteredIndexfilterDefinitionget_FilterDefinitionset_FilterDefinitionpartitionSchemeget_PartitionSchemeset_PartitionSchemeidMicrosoft.SqlServer.SqlEnumIndexKeyTypeindexKeyTypeget_KeyTypeisXmlIndexget_IsXmlIndexavailableForOnlineScriptingget_IsAvailableForOnlineScriptingset_IsAvailableForOnlineScriptingselectedForOnlineScriptingget_IsSelectedForOnlineScriptingset_IsSelectedForOnlineScriptingStripSquareBracketsInitializeScriptObjectget_ColumnsGetColumnsAsyncLoadColumnsQueryColumnsQueryColumnsCallbackQueryColumnsFinishedadd_QueryColumnsFinishedremove_QueryColumnsFinishedOnQueryColumnsFinishedcolumnsqueryColumnsqueryColumnsSyncRootqueryColumnsLastErrorget_PartitionColumnsGetPartitionColumnsAsyncQueryPartitionColumnsQueryPartitionColumnsCallbackQueryPartitionColumnsFinishedadd_QueryPartitionColumnsFinishedremove_QueryPartitionColumnsFinishedOnQueryPartitionColumnsFinishedpartitionColumnsqueryPartitionColumnsqueryPartitionColumnsSyncRootqueryPartitionColumnsLastErrorTableIsClusteredIsUniqueSizeValueFileGroupIsFilteredIndexFilterDefinitionKeyTypeIsXmlIndexIsAvailableForOnlineScriptingIsSelectedForOnlineScriptingColumnsPartitionColumnsinputTableOrViewstatisticNamescanTypeget_ScanTypeset_ScanTypesampleValueget_SampleValueset_SampleValueScanTypeSampleValueincludedget_IsIncludedColumndescendingget_IsDescendingToStringIsIncludedColumnIsDescendingvalue__FilePlanCachewklTypeget_Typeset_TypewklFileNameget_FileNameset_FileNamewklTableget_WorkloadTableset_WorkloadTableset_XmlTypeFileNameDefaultTuningTimeMaximumKeyIndexColumnsLimitMaximumIndexColumnsLimit80MaximumIndexColumnsLimitreportSetAddNewReportTypeGetReportSetClearReportSetfeatureSetget_FeatureSetset_FeatureSetfeatureSetFlagget_IsFeatureSetSetpartitioningStrategyget_PartitioningStrategyset_PartitioningStrategypartitioningStrategyFlagget_IsPartitioningStrategySetkeepExistingStructuresget_KeepExistingStructuresset_KeepExistingStructureskeepExistingStructuresFlagget_IsKeepExistingStructuresSetdropOnlyModeget_DropOnlyModeset_DropOnlyModeevaluateOnlyModeget_EvaluateOnlyModeset_EvaluateOnlyModeabsoluteConfiguationget_IsAbsoluteConfigurationset_IsAbsoluteConfigurationonlineRecommendationOptionsget_OnlineIndexOperationset_OnlineIndexOperationmaximumStorageSizeget_MaximumStorageSizeset_MaximumStorageSizemaximumStorageSizeFlagget_IsMaximumStorageSizeSetResetMaximumStorageSizetuningTimeLimitget_TuningTimeset_TuningTimetuningTimeLimitFlagget_IsTuningTimeSetnumberOfEventsget_NumberOfEventsset_NumberOfEventsnumberOfEventsFlagget_IsNumberOfEventsSetminimumImprovementget_MinimumImprovementset_MinimumImprovementminimumImprovementFlagget_IsMinimumImprovementSettestServerget_TestServerset_TestServererrorTableget_ErrorTableset_ErrorTableerrorTableFlagget_IsErrorTableSetmaxIndexColumnsget_MaximumIndexColumnsset_MaximumIndexColumnsmaxIndexColumnsFlagget_IsMaximumIndexColumnsSetmaxKeyIndexColumnsget_MaximumKeyIndexColumnsset_MaximumKeyIndexColumnsmaxKeyIndexColumnsFlagget_IsMaximumKeyIndexColumnsSetdatabaseToConnectget_DatabaseToConnectset_DatabaseToConnectrecommendFilteredIndexesget_RecommendFilteredIndexesset_RecommendFilteredIndexesunrecognizedTuningOptionsget_UnrecognizedTuningOptionsdisableFilterByDatabaseIdget_DisableFilterByDatabaseIdset_DisableFilterByDatabaseIdignoreConstantsInWorkloadget_IgnoreConstantsInWorkloadset_IgnoreConstantsInWorkloadretainShellDBget_RetainShellDBset_RetainShellDBValidateFeatureSetCombinationFeatureSetIsFeatureSetSetPartitioningStrategyIsPartitioningStrategySetKeepExistingStructuresIsKeepExistingStructuresSetDropOnlyModeEvaluateOnlyModeIsAbsoluteConfigurationOnlineIndexOperationMaximumStorageSizeIsMaximumStorageSizeSetTuningTimeIsTuningTimeSetNumberOfEventsIsNumberOfEventsSetMinimumImprovementIsMinimumImprovementSetTestServerIsErrorTableSetMaximumIndexColumnsIsMaximumIndexColumnsSetMaximumKeyIndexColumnsIsMaximumKeyIndexColumnsSetDatabaseToConnectRecommendFilteredIndexesUnrecognizedTuningOptionsDisableFilterByDatabaseIdIgnoreConstantsInWorkloadRetainShellDBHighTraceNormalTraceLowTraceComponentNameDtaSchemaNamespaceDtaEngineProcessTimeoutMinutesInvokeIAsyncResultAsyncCallbackBeginInvokeEndInvokeTimeSpanworkloadConsumptionget_WorkloadConsumptiontimeElapsedget_TimeElapsedworkloadConsumptionMessageget_WorkloadConsumptionMessageWorkloadConsumptionTimeElapsedWorkloadConsumptionMessagereportingProgressget_ReportingProgressReadyScheduledRunningFinishingFinishedAbortingAbortedSuccessNoneDropFullScanSamplePercentageSampleRowsOFFMIXEDONIDX_IVIDXIVNCL_IDXNONEFULLALIGNEDALLCL_IDXPendingTuningReportingRowsetSTMT_COSTEVT_FREQSTMT_DETCUR_STMT_IDXREC_STMT_IDXSTMT_COSTRANGECUR_IDX_USAGEREC_IDX_USAGECUR_IDX_DETREC_IDX_DETVIW_TABWKLD_ANLDB_ACCESSTAB_ACCESSCOL_ACCESSUnknownPersonalDesktopDeveloperStandardEnterpriseMaximumSessionNameLengthget_FinalSessionStatusfinishStatusget_FinishStatuserrorsget_ErrorsFinalSessionStatusErrorsget_Indexget_Scriptget_Descriptionget_IsErrorindexdescriptionisErrorDescriptionIsErrorSynchronizeCollectionsByKeysSystem.GlobalizationCultureInfodefaultCultureget_DefaultCultureIsFatalExceptionOutputErrorsSqlSmoObjectScriptCreateScriptDropEscapeStringEscapeStringCBracketEscapeStringSQuoteUnEscapeStringUnEscapeStringCBracketUnEscapeStringSQuoteParseSchemaAndObjectNameParseFullyQualifiedObjectNameParseColumnsDefinitionParsePartitionSchemeDefinitionProduceSchemaQualifiedNameIsSessionNameUniqueXmlElementGetOuterXmlDefaultCulturecultureInfoCompareOptionscoSystem.Runtime.SerializationSerializationInfoStreamingContextserverget_Cultureset_Cultureget_LoginIsNotSysAdminget_NonSysAdminCannotInitializeMsdbget_EmptyWorkloadget_InvalidSessionXmlget_InvalidSessionXmlSchemaget_InvalidSessionXmlNodeNotFoundget_InvalidSessionXmlUnexpectedNodeFoundget_InvalidConfigurationXmlSchemaget_InvalidConfigurationXmlAtNodeget_InvalidConfigurationXmlNodeNotFoundget_InvalidConfigurationXmlUnexpectedNodeFoundget_InvalidConfigurationXmlUnexpectedIndexColumnAttributeget_InvalidConfigurationXmlDatabaseWasNotSelectedForTuningget_InvalidConfigurationXmlTableWasNotSelectedForTuningget_InvalidConfigurationXmlTableDoesNotExistget_InvalidSessionIDget_CannotGenerateScriptRecommendationsForDatabaseget_CannotGenerateAddScriptRecommendationsForPartitionFunctionget_CannotGenerateDropScriptRecommendationsForPartitionFunctionget_CannotGenerateAddScriptRecommendationsForPartitionSchemeget_CannotGenerateDropScriptRecommendationsForPartitionSchemeget_CannotGenerateScriptRecommendationsForTableget_CannotGenerateAddScriptRecommendationsForViewget_CannotGenerateDropScriptRecommendationsForViewget_CannotGenerateScriptRecommendationsForViewget_CannotGenerateAddScriptRecommendationsForIndexget_CannotGenerateAddScriptRecommendationsForStatisticget_CannotGenerateDropScriptRecommendationsForIndexget_CannotGenerateDropScriptRecommendationsForStatisticget_CannotGenerateAddScriptForUnrecognizedRecommendationget_CannotGenerateDropScriptForUnrecognizedRecommendationget_MaximumStorageSizeNeedsToBePositiveget_TunigProcessExitedUnexpectedlyget_ErrorInStatusMonitorget_ErrorInProgressMonitorget_CannotSelectObjectForScriptingUnlessItHasValidRecommendationget_CannotSelectObjectForInputConfigurationUnlessItHasValidRecommendationget_PropertyIsUnavailableWhenRunningInConsoleModeget_ProjectedRowsMustBeGreaterThanZeroget_DuplicateJobNameFoundget_FailedToInitializeMsdbDatabaseForTuningget_CannotConnectToSqlExpressget_CannotConnectToSqlAzureget_CannotConnectInSingleUserModeget_ExitCodeUnableToConnectget_ExitCodeCommunicationLinkFailureget_ExitCodePermissionDeniedget_ExitCodeTimeoutExpiredTuningTimeHasToBePositiveNumberOfIndexColumnsIsOutsideTheRangeNumberOfKeyIndexColumnsIsOutsideTheRangeNumberOfEventsIsInvalidCannotParseSchemaQualifiedNameCannotParseFullyQualifiedNameRecommendationAlreadyProvidedNotSupportedPartitionFunctionTypeArgUnknownArgUnexpectedArgDuplicatedArgMissingValueArgCannotInterpretValueCultureLoginIsNotSysAdminNonSysAdminCannotInitializeMsdbEmptyWorkloadInvalidSessionXmlInvalidSessionXmlSchemaInvalidSessionXmlNodeNotFoundInvalidSessionXmlUnexpectedNodeFoundInvalidConfigurationXmlSchemaInvalidConfigurationXmlAtNodeInvalidConfigurationXmlNodeNotFoundInvalidConfigurationXmlUnexpectedNodeFoundInvalidConfigurationXmlUnexpectedIndexColumnAttributeInvalidConfigurationXmlDatabaseWasNotSelectedForTuningInvalidConfigurationXmlTableWasNotSelectedForTuningInvalidConfigurationXmlTableDoesNotExistInvalidSessionIDCannotGenerateScriptRecommendationsForDatabaseCannotGenerateAddScriptRecommendationsForPartitionFunctionCannotGenerateDropScriptRecommendationsForPartitionFunctionCannotGenerateAddScriptRecommendationsForPartitionSchemeCannotGenerateDropScriptRecommendationsForPartitionSchemeCannotGenerateScriptRecommendationsForTableCannotGenerateAddScriptRecommendationsForViewCannotGenerateDropScriptRecommendationsForViewCannotGenerateScriptRecommendationsForViewCannotGenerateAddScriptRecommendationsForIndexCannotGenerateAddScriptRecommendationsForStatisticCannotGenerateDropScriptRecommendationsForIndexCannotGenerateDropScriptRecommendationsForStatisticCannotGenerateAddScriptForUnrecognizedRecommendationCannotGenerateDropScriptForUnrecognizedRecommendationMaximumStorageSizeNeedsToBePositiveTunigProcessExitedUnexpectedlyErrorInStatusMonitorErrorInProgressMonitorCannotSelectObjectForScriptingUnlessItHasValidRecommendationCannotSelectObjectForInputConfigurationUnlessItHasValidRecommendationPropertyIsUnavailableWhenRunningInConsoleModeProjectedRowsMustBeGreaterThanZeroDuplicateJobNameFoundFailedToInitializeMsdbDatabaseForTuningCannotConnectToSqlExpressCannotConnectToSqlAzureCannotConnectInSingleUserModeExitCodeUnableToConnectExitCodeCommunicationLinkFailureExitCodePermissionDeniedExitCodeTimeoutExpiredSystem.ResourcesResourceManagerresourceManager_cultureGetStringget_GeneralCategoryget_StatusCategoryget_DefaultValueNameget_Usageget_Versionget_Readyget_Scheduledget_Runningget_Finishingget_Finishedget_Abortingget_Abortedget_Unknownget_Personalget_Desktopget_Developerget_Standardget_Enterpriseget_JobTitleget_JobScheduleget_JobCategorySwitchingDbContextApplyingCreateRecommendationApplyingCreateRecommendation2ApplyingDropRecommendationApplyingDropRecommendation2JobStepTitleGeneralCategoryStatusCategoryDefaultValueNameUsageVersionJobTitleJobScheduleJobCategoryfunctionNamenumberOfPartitionsget_NumberOfPartitionsset_NumberOfPartitionsvaluesget_ValuesRangeTyperangeTypeget_RangeTypeset_RangeTypeparametersget_ParametersQueryParametersNumberOfPartitionsValuesParametersfunctionget_FunctiondataTypeget_DataTypeDataTypesmoDataTypeget_SmoDataTypeConvertValueToTypeConvertStringToByteArrayFunctionSmoDataTypeschemeNamepartitionFunctionget_PartitionFunctionset_PartitionFunctionfileGroupsget_FileGroupsQueryFileGroupsFileGroupsYesNoOptionalIgnoreCaseget_ValueNameset_ValueNameMatchesget_IsFoundget_IsCollectionget_ExpectsValueSystem.ReflectionMemberInfoConsumeValueGetShortUsageGetLongUsagefoundConsumeValueHelperGetShortUsageHelperGetLongUsageHelperReadFromStringdefaultValueNameValueNameIsFoundIsCollectionExpectsValueemptyValueexpectsMoreValuesAssemblyInitializeResourceManagerGetResourceManagerGetModuleNameGetUsageTokenizeParseValidateArgumentsTryParseget_HelpshowHelpGetMembersGetVersionInfoGetAssemblyTitleGetCompanyNameGetCopyrightGetFileVersionGetVersionAttributeAttributeTypeFindArgumentShowShowErrorShowVersionInfomembersParserHelpInfoStdInputHandleStdOutputHandleStdErrorHandleGetStdHandleGetConsoleScreenBufferInfoXYLeftTopRightBottomdwSizedwCursorPositionwAttributessrWindowdwMaximumWindowSizeget_StopAllThreadsset_StopAllThreadsget_CommandTimeoutget_DatabaseContextCreateNewConnectionDisposeConnectionSqlCommandExecuteNonQuerySqlDataReaderExecuteReaderExecuteQueryExecuteQueryAsyncInsertQueryIntoQueueCleanUpQueueStartThreadIfNeededRunSyncQueryExecuteQueryThreadProcTraceInfoTraceVerboseTraceErrorconnectionInfomainConnectionqueryQueuequeryQueueEventexecuteQueryThreadexecuteQueriesstopAllThreadssessionsCounterQueryQueueStopAllThreadsCommandTimeoutDatabaseContextBeginQueryEndQueryget_PriorityWaitHandleget_AsyncWaitHandleget_Callbackget_LastErrorset_LastErrorPriorityAsyncWaitHandleCallbackLastErrorFinalizequeryMethodcallbackprioritylastErrorwaitHandlecommandGetReaderreaderanyOptionSetget_IsAnyOptionSetquotedIdentifierget_QuotedIdentifierarithAbortget_ArithAbortconcatNullYieldsNullget_ConcatNullYieldsNullansiNullsget_AnsiNullsansiPaddingget_AnsiPaddingansiWarningsget_AnsiWarningsnumericRoundAbortget_NumericRoundAbortGenerateSetOptionsIsAnyOptionSetQuotedIdentifierArithAbortConcatNullYieldsNullAnsiNullsAnsiPaddingAnsiWarningsNumericRoundAbortVersionStringBuildVersionSPLevelProductVersionStringProductNameStringSqlEngineUsageMetricsRoleGuidStringProductNameBrandingStringLongProductNameBrandingStringProductNameShortcutBrandingStringVersionLocationStringProductVersionLocationStringVersionHelpKeywordPrefixVersionHelpSettingsTokenSetupSupportFolderProductLicenseFileProductUpdateCategorySqlProductFamilyCodeProductDiscoveryIdSqlInstanceIDPrefixAsInstanceIDPrefixRsInstanceIDPrefixMaxMaintenanceVersionevalTimeBombValuecurrentReleaseTimeBombValueWerEventNameSetupMsiWerEventNameSetupConfigASUsageMetricsRoleGuidStringVersionBIDSHelpNamespaceVisualStudioShellVersionget_VersionHelpNamespaceVersionHelpNamespacewgenerateRecommendationElementcomparericoninfoconnectionwaitUntilFinishedxycreatedstatuswithProgressEventsstartingTuningtuningOptionsvalidateXmlSchemasenderargsdtaInputNodereportTypeoutputFileNameuseNewConnectionlastRowRetrievedfrequencyOnlyoutputXmltuningSummaryconfigurationNodeinputincludeDatabaseContextschedulejobsvrverifyUniquenessnewNamequerydbesessionIDisExistingtableforTablespopulateIndexesrefreshIndexesscripterschemaviewtableViewNamesmoTableViewrowsschemaQualifiedNamedefinitionviewNodesmoViewtableOrViewindexNodesourcesmoIndexstatNodesmoStatworkloadNodepartitioningkeepExistingobjectmethodresultoldListnewListscexceptionscriptObjectscriptDropsscEscSystem.Runtime.InteropServicesOutAttributefullNamedatabaseNameIsOptionalthisSessionxmlElementmessageinnerExceptioninfocontexttimenummaxColumnsobjectNameargumentkeyarg0arg1dbNameparentObjectNamestepNumberpartitionFunctionNamesmoPartitionFunctionparameterNamepartitionSchemeNamesmoPartitionSchemedefaultNamecontainerprefixvalueNametyperesourceNameassemblycommandLineerrattributehWndhConsoleOutputlpConsoleScreenBufferInfodisposingsqlStmtsComVisibleAttributeAssemblyVersionAttributeAssemblyProductAttributeAssemblyCopyrightAttributeAssemblyCompanyAttributeAssemblyFileVersionAttributeAssemblyInformationalVersionAttributeAssemblyKeyFileAttributeAssemblyDelaySignAttributeAssemblyTrademarkAttributeAssemblyTitleAttributeAssemblyDescriptionAttributeAssemblyConfigurationAttributeAssemblyCultureAttributeNeutralResourcesLanguageAttributeCLSCompliantAttributeInternalsVisibleToAttributeAssemblyKeyNameAttributeDebuggableAttributeDebuggingModesCompilationRelaxationsAttributeRuntimeCompatibilityAttributeDTAClientXmlWriterWriteStartElementWriteRawWriteEndElementDefaultMemberAttributeIndexOfKeyGetByIndexSqlMgmtMicrosoft.SqlServer.Management.SqlMgmtStringResourceClassAttributeStringEmptySqlOlapConnectionInfoBaseIDbConnectionCreateConnectionObjectSystem.Data.CommonDbConnectionOpenCopyCloseConnectionStateget_StateConnectionManagerServerVersionget_ServerVersionget_Majorget_Minorget_QueryTimeoutDbCommandset_CommandTimeoutExecuteScalarInt32InvalidOperationExceptionget_ServerNameFixedServerRolesIsInFixedServerRoleFormatProcessStartInfoGetCurrentProcessProcessModuleget_MainModuleLastIndexOfSubstringConcatProcessWindowStyleset_WindowStyleIFormatProviderset_ArgumentsWaitForExitget_ExitCodeSystem.ConfigurationConfigurationManagerNameValueCollectionget_AppSettingsget_LengthConvertToInt32get_CurrentThreadget_CurrentUICultureMicrosoft.SqlServer.Management.Sdk.SfcRequestUrnop_Implicitset_UrnPropertiesRequestset_Fieldsget_FieldsEnumeratorSqlDirectConnectionEnumResultDataTableCollectionDataTableDataRowCollectionget_RowsDataRowCommandTypeset_CommandTypeget_NowDbDataReaderGetInt32GetByteGetDateTimeReadSortget_CountInsertRemoveAtSqlExceptionDelegateCombineInterlockedCompareExchangeThreadStartEventWaitHandleSetJoinWaitOneSystem.ComponentModelBrowsableAttributeReadOnlyAttributeDefaultValueAttributeDisplayNameAttributeCategoryAttributeComparer`1get_DefaultStructLayoutAttributeLayoutKindSqlParameterCreateParameterDbParameterset_ParameterNameParameterDirectionset_DirectionSqlDbTypeset_SqlDbTypeSqlParameterCollectionNextResultget_FieldCountIsDBNullop_SubtractionSleepset_CommandTextComponentget_HasExitedSystem.TextStringBuilderSystem.IOStringWriterTextWriterFormattingset_FormattingWriteStartDocumentWriteAttributeStringWriteElementStringICollectionIEnumerableIEnumeratorGetEnumeratorget_CurrentMoveNextWriteEndDocumentXmlDocumentGetExecutingAssemblyStreamGetManifestResourceStreamXmlReaderSettingsXmlSchemaSetget_SchemasCreateXmlSchemaValidationTypeset_ValidationTypeValidationEventHandleradd_ValidationEventHandlerStringReaderTextReaderLoadXmlNodeListGetElementsByTagNameget_ItemOfget_Messageget_FirstChildget_InvariantCultureToUpperop_EqualityStringComparisonget_NextSiblingget_InnerTextTrimXmlAttributeCollectionget_AttributesXmlAttributeExecuteXmlReaderEncodingget_UnicodeStreamWriterMemoryStreamWriteFlushSeekOriginSeekXmlNodeTypeMoveToContentXmlWriterSettingsset_Indentset_CloseOutputWriteNodeSqlDataAdapterDataAdapterFillArgumentExceptionop_Inequalityget_HasChildNodesStringEnumeratorset_DefaultTextModeScriptingOptionsget_Optionsset_ClusteredIndexesset_NonClusteredIndexesset_IncludeDatabaseContextset_PrefetchObjectsDatabaseCollectionMaxValueget_JobServerJobset_CategoryApplyToTargetServerJobStepAgentSubSystemset_SubSystemStepCompletionActionset_OnSuccessActionAppendset_Commandset_ActiveStartDateget_TimeOfDayget_Hoursget_Minutesget_Secondsset_ActiveStartTimeOfDayFrequencyTypesset_FrequencyTypesJobCollectionget_JobsContainsByteMonitorEnterWaitExitResultTypeset_ResultTypeget_DataIDataRecordPulseAllClear.cctorInternalDataCollectionBaseToByteGetInt64GetDoubleOrderByDirectionset_OrderByListset_ParentPropertiesRequestsget_ParentPropertiesRequestsGetBooleanIsNullOrEmptyget_CurrentCultureContainsKeyToInt64TableCollectionset_TextBodyset_IsSchemaBoundViewCollectionget_OuterXmlToSingleXmlNamedNodeMapInt64WriteStringRuntimeTypeHandleGetTypeFromHandleToObjectSingleStartsWithEndsWithIndexedColumnIndexedColumnCollectionget_IndexedColumnsset_Descendingset_IsIncludedPartitionSchemeParameterCollectionget_PartitionSchemeParametersPartitionSchemeParameterset_IndexKeyTypeSqlPropertyCollectionget_PropertiesPropertyCollectionPropertyGetBooleanSetValueSetRetrievedTableViewTableTypeBaseIndexCollectionget_StatisticColumnsStatisticsScanTypeSetScanOptionsStatisticCollectionAppendFormatArrayToArrayGetName<PrivateImplementationDetails>{EB9374DF-7997-4EE9-B0FD-C80B2E54A825}CompilerGeneratedAttributeDictionary`2$$method0x6000226-1TryGetValueGetKeyExecutionEngineExceptionOutOfMemoryExceptionAccessViolationExceptionBadImageFormatExceptionInvalidProgramExceptionEnvironmentget_NewLineget_InnerExceptionset_ScriptDropsget_CharsSystem.Text.RegularExpressionsRegexRegexOptionsMatchGroupget_SuccessGroupCollectionget_GroupsCaptureNextMatchCaptureCollectionget_Capturesset_Namespacesget_Prefixget_LocalNameget_HasAttributesWriteToget_IsEmptyWriteContentToWriteFullEndElementSqlSupportGetCompareOptionsFromCollationEqualsCreateSpecificCultureCompareInfoget_CompareInfoSerializableAttributeget_FullNameModuleget_Moduleget_Assemblyget_PartitionFunctionParametersset_RangeValuesToLowerInvariantCompareOrdinalNumberStyles$$method0x6000325-1get_BigIntBinarySqlDataTypeget_BitCharget_Dateget_DateTimeDateTime2DateTimeOffsetget_Floatget_Intget_MoneyNCharNVarCharget_Realget_SmallDateTimeget_SmallIntget_SmallMoneyTimeget_TinyIntget_UniqueIdentifierVarBinaryVarCharget_Variantget_SqlDataTypeDateTimeStylesSystem.Data.SqlTypesSqlDecimalSqlMoneyDoubleInt16GuidIConvertibleAttributeUsageAttributeAttributeTargetsPropertyInfoFieldInfoGetValueIListget_FieldTypeBindingFlagsBinderget_PropertyTypeTargetInvocationExceptionIntPtrop_ExplicitMathMinReplaceIndexOfMicrosoft.SqlServer.SStringMicrosoft.SqlServer.CommonSqlSecureStringTypeDescriptorTypeConverterGetConverterITypeDescriptorContextConvertFromStringPathGetFullPathSystem.Security.PermissionsSecurityPermissionAttributeSecurityActionGetEntryAssemblyget_LocationGetFileNameIsWhiteSpaceGetTypeMemberTypesget_MemberTypeGetCustomAttributesget_Titleget_Companyget_CopyrightConsoleWriteLineArgumentNullExceptionSystem.SecuritySuppressUnmanagedCodeSecurityAttributeDllImportAttributekernel32.dllset_StatementTimeoutSynchronizedGCCollectget_SqlConnectionObjectget_IsAliveResetSuppressFinalizeMethodInfoget_MethodNotImplementedExceptionget_CommandTextset_Connectionget_StatementTimeout$$method0x60003f5-1Microsoft.SqlServer.Management.DTA.Client.ExceptionText.resourcesMicrosoft.SqlServer.Management.DTA.Client.SR.resourcesDTA_tables.sqlDTA_functions.sqlDTA_functions80.sqldtaschema.xsdRecommendation
Create	DropMselect SERVERPROPERTY('EngineEdition')Kselect SERVERPROPERTY('IsSingleUser')SELECT COUNT(*) FROM msdb.dbo.sysobjects WHERE name IN ( N'sp_DTA_add_session',N'sp_DTA_delete_session',N'sp_DTA_help_session',N'sp_DTA_update_session',N'sp_DTA_get_tuninglog',N'sp_DTA_update_session',N'sp_DTA_get_session_report',N'sp_DTA_get_tuninglog',N'sp_DTA_get_session_tuning_results',N'sp_DTA_set_interactivestatus' ) AND type = 'P' AND uid = {0}('dbo')USER_ID+DATABASE_PRINCIPAL_IDDTAEngine.exe-S{0} -E -I)-S{0} -U{1} -P{2} -I5IgnoreInitMsdbProcessError?Server/Database[@Name='master']Collation3msdb..sp_DTA_help_session/Server Status Monitor <>-S{0} -E -W{1}/-S{0} -U{1} -P{2} -W{3}5Session Progress Monitor <@SessionIDOmsdb..sp_DTA_get_session_tuning_results1msdb..sp_DTA_add_session@SessionName@TuningOptions7msdb..sp_DTA_delete_session
DTAXMLxmlns:xsiShttp://www.w3.org/2001/XMLSchema-instancexmlnsehttp://schemas.microsoft.com/sqlserver/2004/07/dtaDTAInput
Server	NameDatabaseWorkload	FileConfiguration#SpecificationModeRelativeAbsolute+@IncludeTuningOptionsdtaschema.xsd
SERVERWORKLOADTUNINGOPTIONSCONFIGURATION	NAMENAME (SERVERDATABASENAME (DATABASE)ABSOLUTE?msdb..sp_DTA_get_session_report@ReportID@ReportType5msdb..sp_DTA_get_tuninglogconnection	@XML#@LastRowRetrieved3@GetFrequencyForRowIDOnlyTuningSummaryReportEntryValueNAME (SERVER)use [{0}]=Database Engine Tuning Advisor


go

{0} {1}7msdb..sp_DTA_update_session%@InteractiveStatus[Server/Database[BitWiseAnd(@Status,{0}) != 0]-SessionProgressMonitor]Trace events related to monito progress thread%CompatibilityLevel9Server/Database[@Name='{0}']/Server/Database[@Name='C']/Table[@IsSystemObject!=true()]ID
SchemaRowCountDataSpaceUsedIndexSpaceUsedA']/View[@IsSystemObject!=true()]	Text']/	ViewTable5[@IsSystemObject!=true()]/StatisticIndexIsClusteredIsUniqueIndexKeyTypeIsXmlIndex!FilterDefinition)']/PartitionFunctionRangeType%NumberOfPartitions%']/PartitionScheme#PartitionFunction[{0}]
SCHEMANAME (SCHEMA)TABLENAME (TABLE)NumberOfRowsRECOMMENDATION
CREATE	DROP#PARTITIONFUNCTION1NAME (PARTITIONFUNCTION)PARTITIONSCHEME-NAME (PARTITIONSCHEME)	VIEWNAME (VIEW)VIEWDEFINITIONViewDefinitionINDEXSTATISTICSNAME (INDEX)CLUSTERED
UNIQUEINDEXSIZEINMB
ONLINEFILTEREDINDEX	true	SizeActualRows{0}NAME (COLUMN)SORTORDER	TYPEDESCENDINGINCLUDEDCOLUMN
COLUMNFILEGROUPPARTITIONCOLUMN!FILTERDEFINITIONClusteredfalse
Unique
OnlineFilteredIndexIndexSizeInMBPartitionSchemePartitionColumnFileGroup[PRIMARY][]Server/Database[@Name='{0}']/{1}[@Name='{2}' and @Schema='{3}']/Index[@Name='{4}']/IndexedColumnDescendingIsIncludedServer/Database[@Name='{0}']/{1}[@Name='{2}' and @Schema='{3}']/Index[@Name='{4}']/PartitionSchemeParameterFULLSCAN!SAMPLEPERCENTAGESAMPLEROWSStatisticsFullScan!SamplePercentageSampleRows!']/Table[@Name='' and @Schema=')']/Statistic[@Name='']/Column
ColumnSortOrderAscending	TypeKeyColumnIncludedColumn[{0}] {1}asc	descServerCache	FILESERVERCACHE#[{0}].[{1}].[{2}]+DATABASE (ERRORTABLE)5NAME (ERRORTABLE DATABASE)'SCHEMA (ERRORTABLE)1NAME (ERRORTABLE SCHEMA)%TABLE (ERRORTABLE)/NAME (ERRORTABLE TABLE)TuningOptionsReportSet
ReportNumberOfEventsTuningTimeInMin!StorageBoundInMB)MaxKeyColumnsInIndex#MaxColumnsInIndex1MinPercentageImprovementTestServer+EvaluateConfigurationDropOnlyModeFeatureSetPartitioningKeepExisting)OnlineIndexOperation#DatabaseToConnect3IgnoreConstantsInWorkload1RecommendFilteredIndexesRetainShellDB3DisableFilterByDatabaseIdTuningLogTable=TuningOptionsErrorDropOnlyMode?TuningOptionsErrorFilteredIndex;TuningOptionsErrorKeepAligned9TuningOptionsErrorAddAligned=TuningOptionsErrorNonClustered=TuningOptionsErrorIndexedViews--en-US\[((?:(?:\]{2})*[^\x5D]+(?:\]{2})*)+)\]\.\[((?:(?:\]{2})*[^\x5D]+(?:\]{2})*)+)\]\[((?:(?:\]{2})*[^\x5D]+(?:\]{2})*)+)\]\.(?:\[((?:(?:\]{2})*[^\x5D]+(?:\]{2})*)+)\])?\.\[((?:(?:\]{2})*[^\x5D]+(?:\]{2})*)+)\]dboc^([^\x5D\.\s]+)\.([^\x5D\.\s]+)?\.([^\x5D\.\s]+)$q^(\[((?:(?:\]{2})*[^\x5D]+(?:\]{2})*)+)\]|[^\x5D\.\s]+)$e\[((?:(?:\]{2})?[^\x5D]+(?:\]{2})?)+)\] (desc|asc)(\w+) \((?:(\[((?:(?:\]{2})?[^\x5D]+(?:\]{2})?)+)\])[,]?[ ]?)+\)].[?SQL_Latin1_General_CP1254_CI_ASTurkishtr%LoginIsNotSysAdmin?NonSysAdminCannotInitializeMsdbEmptyWorkload#InvalidSessionXml/InvalidSessionXmlSchema;InvalidSessionXmlNodeNotFoundIInvalidSessionXmlUnexpectedNodeFound;InvalidConfigurationXmlSchema;InvalidConfigurationXmlAtNodeGInvalidConfigurationXmlNodeNotFoundUInvalidConfigurationXmlUnexpectedNodeFoundkInvalidConfigurationXmlUnexpectedIndexColumnAttributemInvalidConfigurationXmlDatabaseWasNotSelectedForTuninggInvalidConfigurationXmlTableWasNotSelectedForTuningQInvalidConfigurationXmlTableDoesNotExist!InvalidSessionID]CannotGenerateScriptRecommendationsForDatabaseuCannotGenerateAddScriptRecommendationsForPartitionFunctionwCannotGenerateDropScriptRecommendationsForPartitionFunctionqCannotGenerateAddScriptRecommendationsForPartitionSchemesCannotGenerateDropScriptRecommendationsForPartitionSchemeWCannotGenerateScriptRecommendationsForTable[CannotGenerateAddScriptRecommendationsForView]CannotGenerateDropScriptRecommendationsForViewUCannotGenerateScriptRecommendationsForView]CannotGenerateAddScriptRecommendationsForIndexeCannotGenerateAddScriptRecommendationsForStatistic_CannotGenerateDropScriptRecommendationsForIndexgCannotGenerateDropScriptRecommendationsForStatisticiCannotGenerateAddScriptForUnrecognizedRecommendationkCannotGenerateDropScriptForUnrecognizedRecommendationGMaximumStorageSizeNeedsToBePositive=TunigProcessExitedUnexpectedly)ErrorInStatusMonitor-ErrorInProgressMonitoryCannotSelectObjectForScriptingUnlessItHasValidRecommendationCannotSelectObjectForInputConfigurationUnlessItHasValidRecommendation[PropertyIsUnavailableWhenRunningInConsoleModeEProjectedRowsMustBeGreaterThanZero+DuplicateJobNameFoundOFailedToInitializeMsdbDatabaseForTuning3CannotConnectToSqlExpress/CannotConnectToSqlAzure;CannotConnectInSingleUserMode/ExitCodeUnableToConnectAExitCodeCommunicationLinkFailure1ExitCodePermissionDenied-ExitCodeTimeoutExpired3TuningTimeHasToBePositiveKNumberOfIndexColumnsIsOutsideTheRangeQNumberOfKeyIndexColumnsIsOutsideTheRange/NumberOfEventsIsInvalid=CannotParseSchemaQualifiedName;CannotParseFullyQualifiedName;RecommendationAlreadyProvidedCNotSupportedPartitionFunctionTypeArgUnknownArgUnexpectedArgDuplicatedArgMissingValue/ArgCannotInterpretValueGeneralCategoryStatusCategory
StatusCreationTimeEditionMajorVersionMinorVersionUserName!DefaultValueNameUsageVersionReadyScheduledRunningFinishingFinishedAbortingAbortedUnknownPersonalDesktopDeveloperStandardEnterpriseJobTitleJobScheduleJobCategory%SwitchingDbContext9ApplyingCreateRecommendation;ApplyingCreateRecommendation25ApplyingDropRecommendation7ApplyingDropRecommendation2JobStepTitle%ARGUMENTTOFUNCTIONPARTITIONTYPERANGEBoundary	LEFTVALUE
IsNullFALSEPartitionTypeRange9']/PartitionFunction[@Name=';']/PartitionFunctionParameter^(?<type>[a-zA-Z_2]+) [\s]* (?:\( [\s]* (?<lenght>[0-9]+|max) [\s]* \))?$max
bigint
binarybit	char	datedatetimedatetime2datetimeoffsetdecimalnumericfloatintmoneyncharnvarchar	realsmalldatetimesmallintsmallmoney	timetinyint!uniqueidentifiervarbinaryvarcharsql_variant%ArgumentToFunction0x5']/PartitionScheme[@Name='']/FileGroup 


				

{0}[, {0}]

	-(C)CmdLineParserITraces events in Command Line Parser	infoattributeCTraceConnection.Connect() - enterATraceConnection.Connect() - exitITraceConnection.Disconnect() - enter+Stopping query thread)Query thread stoppedGTraceConnection.Disconnect() - exit[TraceConnection.CreateNewConnection() - enterYTraceConnection.CreateNewConnection() - exitWTraceConnection.DisposeConnection() - enterUTraceConnection.DisposeConnection() - exitSTraceConnection.ExecuteNonQuery() - enterQTraceConnection.ExecuteNonQuery() - exitOTraceConnection.ExecuteReader() - enterMTraceConnection.ExecuteReader() - exitMTraceConnection.ExecuteQuery() - enterKTraceConnection.ExecuteQuery() - exitWTraceConnection.ExecuteQueryAsync() - enterUTraceConnection.ExecuteQueryAsync() - exit]TraceConnection.InsertQueryIntoQueue() - enter5Signaling the query thread[TraceConnection.InsertQueryIntoQueue() - exitMTraceConnection.CleanUpQueue() - enterKTraceConnection.CleanUpQueue() - exit[TraceConnection.StartThreadIfNeeded() - enter1Creating queryQueueEvent+Creating query thread-Query execution threadYTraceConnection.StartThreadIfNeeded() - exitMTraceConnection.RunSyncQuery() - enter3Executing sync query: {0}'Finished query: {0}=Error in query: {0}, error {1}KTraceConnection.RunSyncQuery() - exit?Starting ExecuteQueryThreadProc1Query queue non empty...#Picked query: {0}5Executing async query: {0}=Exiting ExecuteQueryThreadProcQueryQueueSEvents related to per-session query queue+Disposing wait handle;AsyncQuery: {0}, Priority {1}9SyncQuery: {0}, Priority {1}5Command: {0}, Priority {1}#QUOTED_IDENTIFIERARITHABORT/CONCAT_NULL_YIELDS_NULLANSI_NULLSANSI_PADDINGANSI_WARNINGS%NUMERIC_ROUNDABORT3SET QUOTED_IDENTIFIER {0}OFFON%SET ARITHABORT {0}?SET CONCAT_NULL_YIELDS_NULL {0}%SET ANSI_NULLS {0})SET ANSI_PADDING {0}+SET ANSI_WARNINGS {0}5SET NUMERIC_ROUNDABORT {0}-ms-help://MS.SQLCC.v11tyN.T%z\V4	$	$	l	t	0	        9 9((((
    (< <-  ((]̀̑ = =AA A= = ( (  $   EI(A(=((( $$    M| |QU U UY Y   ]a   e im m	 qA	 uA y y qA i	 }	 	
 	 M M   M   @  <@   )(|(U((M((@(( $ $$0	  $ $  L HLX X  , , <<  	($((L(X(,(<( $- < < <(<(< < < 	` `h h(<(`(h <
 <
 
 
 
((
 H	 H
 H H(H(H	 < } T T T T(T(T
 	DD D    pp(D((p(} D- \ \ \(\(\ D   x x((x d d d(d(d  l l(l t(t| | |  (|( <            (((((DTAClientdhttp://schemas.microsoft.com/sqlserver/2004/07/dta  
  
  ( 
   
 	

 } ( 
  
  ) )     } }


U}U}
}
p}$  U	  $U U$LoginIsNotSysAdmin>NonSysAdminCannotInitializeMsdb2TuningTimeHasToBePositiveJNumberOfIndexColumnsIsOutsideTheRangePNumberOfKeyIndexColumnsIsOutsideTheRange.NumberOfEventsIsInvalidEmptyWorkload"InvalidSessionXml.InvalidSessionXmlSchema:InvalidSessionXmlNodeNotFoundHInvalidSessionXmlUnexpectedNodeFound:InvalidConfigurationXmlSchema:InvalidConfigurationXmlAtNodeFInvalidConfigurationXmlNodeNotFoundTInvalidConfigurationXmlUnexpectedNodeFoundjInvalidConfigurationXmlUnexpectedIndexColumnAttributelInvalidConfigurationXmlDatabaseWasNotSelectedForTuningfInvalidConfigurationXmlTableWasNotSelectedForTuningPInvalidConfigurationXmlTableDoesNotExist InvalidSessionID\CannotGenerateScriptRecommendationsForDatabasetCannotGenerateAddScriptRecommendationsForPartitionFunctionvCannotGenerateDropScriptRecommendationsForPartitionFunctionpCannotGenerateAddScriptRecommendationsForPartitionSchemerCannotGenerateDropScriptRecommendationsForPartitionSchemeVCannotGenerateScriptRecommendationsForTableZCannotGenerateAddScriptRecommendationsForView\CannotGenerateDropScriptRecommendationsForViewTCannotGenerateScriptRecommendationsForView\CannotGenerateAddScriptRecommendationsForIndexdCannotGenerateAddScriptRecommendationsForStatistic^CannotGenerateDropScriptRecommendationsForIndexfCannotGenerateDropScriptRecommendationsForStatistichCannotGenerateAddScriptForUnrecognizedRecommendationjCannotGenerateDropScriptForUnrecognizedRecommendationFMaximumStorageSizeNeedsToBePositive<TunigProcessExitedUnexpectedly(ErrorInStatusMonitor,ErrorInProgressMonitor<CannotParseSchemaQualifiedName:CannotParseFullyQualifiedNamexCannotSelectObjectForScriptingUnlessItHasValidRecommendationCannotSelectObjectForInputConfigurationUnlessItHasValidRecommendationZPropertyIsUnavailableWhenRunningInConsoleModeDProjectedRowsMustBeGreaterThanZero*DuplicateJobNameFoundNFailedToInitializeMsdbDatabaseForTuning2CannotConnectToSqlExpress.CannotConnectToSqlAzure:RecommendationAlreadyProvidedBNotSupportedPartitionFunctionType:CannotConnectInSingleUserModeArgUnknownArgUnexpectedArgDuplicatedArgMissingValue.ArgCannotInterpretValue.ExitCodeUnableToConnect@ExitCodeCommunicationLinkFailure0ExitCodePermissionDenied,ExitCodeTimeoutExpiredGeneralCategoryStatusCategoryNameStatusIDCreationTimeCollationEditionMajorVersionMinorVersionUserName DefaultValueName
UsageVersion
ReadyScheduledRunningFinishingFinishedAbortingAbortedUnknownPersonalDesktopDeveloperStandardEnterprise$SwitchingDbContext8ApplyingCreateRecommendation:ApplyingCreateRecommendation24ApplyingDropRecommendation6ApplyingDropRecommendation2JobTitleJobStepTitleJobScheduleJobCategory <    	4 4((4 ( ((((( (( (   ((( ( 0  	 8 8 8(8(8@  @    (@    h0 hh	 DD		xpt A      ((   
   }11.0.0.0411.0(Microsoft SQL Server{0xbd7f7c0d, 0x7c36, 0x4721, {0xaf, 0xa8, 0xb, 0xa7, 0x0, 0xe2, 0x6d, 0x9e}}SQL Server 20122Microsoft SQL Server 2012110
sql112SQLServerBooksOnline.11.0SQLServer2012H7fe4630a-0330-4b01-a5e6-a77c7ad34eb0L{7f121c35-f095-47aa-bc04-d214bc04727a}SQL2011MSSQL11MSAS11MSRS11SQL110MSISQL110Exception{0x2414bc1b, 0x1572, 0x4cd9, {0x9c, 0xa5, 0x65, 0x16, 0x6d, 0x8d, 0xef, 0x3d}}*ms-help://MS.VSCC.v9010.0 E$$RSA1''6n_1:fl/y2}/R4H<=\]Ǽ(k,Q\$+Au2IRmRo{l؂O1
ˢ#V{-Pb왹J|};( 	Item -    1,Microsoft.SqlServer.Management.DTA.Client.SR e m q yy A  Q    	Q?_
:E QU  	     
y M    M(M$	   
(-


)
  	$UMajorVersionGeneralCategoryMinorVersionEdition
UserName	Collation	  
U
YYYY


     !  MM	MM AMMMU,
,	 ) 1 5 )	)-9)-9< 9 A	)-9)-9<A, I QuI Uu Y ]ue	uuM u e i iEIMauai i m q uiiii<uU	 q uu,y y	 Iy 

 Q1 u}}uQ yyAqA	EIMauaiiiiii	iii<		    }}     <A      )     ') -,
, qIDCreationTimeStatusCategory	NameStatus$$
$$$ 
(8HT
 
 
HqT
q    .qD\d	D+qD	D
q(qHTAA 
H

(8
HT
!iiiiHuHA
(HT          3(8HTN$iiii(i8iiiHiTiiiTi<	\d u'iiii\uid
\dAA
\dH}T
iiui l8 m    ! %l8<  ) 1} = pq}q\iit} A  E It M qd ))llt|ii Q
YY  ii8}	 u	  ))	) }   yyyy 
py yA-$$  Q-9uA      	iiuiu00 	   00(
  
y 


MM



 0
ii u8 m	    U)	 m  x)		
 
	 .System.Security.Permissions.SecurityPermissionAttribute, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089TSerializationFormatter		m
h@
)U	HelpDescrSName?	   hmD ))))hh	)
!!
		




hhh	mm qA m
AU
Um 5uMicrosoft SQL Server)$Microsoft Corp. All rights reserved.Microsoft Corporation,'11.0.2100.60 ((SQL11_RTM).120210-1846 )11.0.2100.6050e:\sql11_main_t\\sql\Common\SNK\SQL2003SNKEY.snkMHMicrosoft SQL Server is a registered trademark of Microsoft Corporation.
en-USa[DTAClient.NUnit, PublicKey=0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8UODTA, PublicKey=0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8ZTDTAShell, PublicKey=0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8TWrapNonExceptionThrows5O&K-RSDS3HK&~yuUgDTAClient.pdb0LNL @L_CorDllMainmscoree.dll% 700HX`884VS_VERSION_INFO<4<4?DVarFileInfo$TranslationStringFileInfot000004b0LCompanyNameMicrosoft Corporation,FileDescription p(FileVersion11.0.2100.60 ((SQL11_RTM).120210-1846 )<InternalNameDTAClient.dllp%LegalCopyrightMicrosoft Corp. All rights reserved.ILegalTrademarksMicrosoft SQL Server is a registered trademark of Microsoft Corporation.DOriginalFilenameDTAClient.dllLProductNameMicrosoft SQL Server@
ProductVersion11.0.2100.60<	Assembly Version11.0.0.0@`<X<0<H	*H
<90<510	+0L
+7>0<0
+70	0!0	+,6ݲ*TVU*%:00
aj0
	*H
0y10	UUS10U
Washington10URedmond10U
Microsoft Corporation1#0!UMicrosoft Code Signing PCA0
111101223917Z
130201224917Z010	UUS10U
Washington10URedmond10U
Microsoft Corporation1
0UMOPR10UMicrosoft Corporation0"0
	*H
0
é|#1%uyϓKa%wKZmI17t`N%X N-:e.[]u4P!}9D#fe 6`*dȇE(WY&Jl)2?%
oj-:mf16p@v.G+e+_hExkP5[qa! EeI~7Z߸v Q*P:c܁G00U%0
+0UqÏv,
J(0U0U#0WEt]CT-2H0VUO0M0KIGEhttp://crl.microsoft.com/pki/crl/products/MicCodSigPCA_08-31-2010.crl0Z+N0L0J+0>http://www.microsoft.com/pki/certs/MicCodSigPCA_08-31-2010.crt0
	*H
yiȏk`|>8Rϙ-=au8NY?C|Sb֨vuYl?/~9T'X5aymQWcrf9*35
^15E
]Ǘ*:IHE26m	nvUU4y]n̗h}i{U}M0b{젒*W)HͶ!	b
5_kԱwRw?lV\6N^z  1ynr_0W|UplxC 500
a60
	*H
0w10	UUS10U
Washington10URedmond10U
Microsoft Corporation1!0UMicrosoft Time-Stamp PCA0
110725204217Z
121025204217Z010	UUS10U
Washington10URedmond10U
Microsoft Corporation1
0UMOPR1'0%UnCipher DSE ESN:159C-A3F7-25701%0#UMicrosoft Time-Stamp Service0"0
	*H
0
4	)cuW}Adxw殸PN q9rr	Aa%kQCaB,{sv+۔aUm.z$hyz]~.j</Ք"Q˩U!ZA9UN%+cr<|rɵ
_r
]
@}.Ы}ѾUkX,6?Cx,)|lܭ<:}b=	00U ޅh7at0U#0#4RFp
@v+50TUM0K0IGEChttp://crl.microsoft.com/pki/crl/products/MicrosoftTimeStampPCA.crl0X+L0J0H+0<http://www.microsoft.com/pki/certs/MicrosoftTimeStampPCA.crt0U%0
+0
	*H
b
OkRyU3ӤH{oz(OзѦ̑V;82/k٘BXRk@Կ&HBDfB^#H[Al6?ߘLIJ_CB"ȓɥgG]vrv<6F~:HI3cWVn>d]Pcр24W@m~.Z^2	2qƯfٞ_#wM(rP00
ah40
	*H
0_10
	&,dcom10
	&,d	microsoft1-0+U$Microsoft Root Certificate Authority0
070403125309Z
210403130309Z0w10	UUS10U
Washington10URedmond10U
Microsoft Corporation1!0UMicrosoft Time-Stamp PCA0"0
	*H
0
lH*|k.řQ#PN$ѧLt0 TIB\0&k{3$g,{N#SʍE	^аBlg(FS(F.'OUR,j0nY0~֗!~SmREHJGf')fJG	UxP0F#F-TxA1w̛;a
"KT 00U00U#4RFp
@v+50U0	+70U#0`@V'%*
SY䤡ca0_10
	&,dcom10
	&,d	microsoft1-0+U$Microsoft Root Certificate AuthorityyJLsX.e0PUI0G0ECA?http://crl.microsoft.com/pki/crl/products/microsoftrootcert.crl0T+H0F0D+08http://www.microsoft.com/pki/certs/MicrosoftRootCert.crt0U%0
+0
	*H
\D6鴭wyQM.tq[mξ{.mbWN Pz@WXx;⾏
ȍHSOjՀ/*$"px.
pNk
r9g-Qb\? ?21Jv1=+rp=

a׸N5+^}B{Sr!0ʻxe\[
<fX-/QVpl9Lyzb))4wb=m,C}㤨t5Nq#&v<RqZFCMgȟBy!0fB^Ȟ"!C+H,2L&*H$_ZVޙ:o'tv!'Tj=vanGo2lQȌ#fd=-Y!嵰cxTA.Pxuْu"/2n[%!OɚIeo}in꧗1)[\M/?.Uk00i
a'0
	*H
0_10
	&,dcom10
	&,d	microsoft1-0+U$Microsoft Root Certificate Authority0
060125232232Z
170125233232Z0y10	UUS10U
Washington10URedmond10U
Microsoft Corporation1#0!UMicrosoft Code Signing PCA0"0
	*H
0
߅7Vf6N
6#X:
$^>3kir|_%D5(Րap-o,ݹ0qxȩg
z	¼W?i00&Ԟ{	IERu{".VϩN<
:ŭj"#l'~2y%B❅WY/-&)ųׅ`Z{{^4Km'Тѐ}|4lJDyh("
,Ha#00	+70UWEt]CT-2H0U0U00U#0`@V'%*
SY䤡ca0_10
	&,dcom10
	&,d	microsoft1-0+U$Microsoft Root Certificate AuthorityyJLsX.e0PUI0G0ECA?http://crl.microsoft.com/pki/crl/products/microsoftrootcert.crl0T+H0F0D+08http://www.microsoft.com/pki/certs/MicrosoftRootCert.crt0vU o0m0k	+7/0^0\+0PNCopyright  2006 Microsoft Corporation.0U%0
+0
	*H
0 b9&a=ܬƙІ.2e^">ֆ趟ʋ;u>LdtIglfF:FBȑ7$AwO_R/>V[uSTie$%MPO"Y"tE{YL`xѺk~D@ҽKnU8HUz }۔/{kdO,4)]8/ V1i΅
֮8nOL))
\\V#W
&6Do阵sx<t^l!g엝r4/j9-[М|St9J9}BJ;7=J{'NJT8j#7jHB
I$.oEM`Y؀`4{ \	
(M~ex1_fB Ee2.Mkޤ
ؘY ,Rid࣫|aCe6U+g,M0L1%0%00y10	UUS10U
Washington10URedmond10U
Microsoft Corporation1#0!UMicrosoft Code Signing PCA
aj0	+0	*H
	1
+70
+710
+70#	*H
	1q8!
N/[0R
+71D0B SQL Server 2012http://www.microsoft.com/sql0
	*H
	^&ΉNyػTYGqQ
wF,]G:
&lf|Q|fڑ3P]3HD
'$US~},ʩA	E^D|9ACjd:fq
@uP:;eQmkÿMےf(-W.;u<nu
E{,_wHB,9Hd0ےm-TyU&6͓͒-BU#u0	*H
	1
000w10	UUS10U
Washington10URedmond10U
Microsoft Corporation1!0UMicrosoft Time-Stamp PCA
a60+]0	*H
	1	*H
0	*H
	1
120211180806Z0#	*H
	1UJ09?K*#4Wp0
	*H
<#ʲ笐B)6EbN_!\sC	\dF$Oo/.SWo2!9XF#VSoA>Zm|O4n?}la~,]T)#XLIelg,z%5̹dLoE^FFMF}l}zFjfj<Z,s=|Й;j5qUXI:c99QH
r3P
ȫga<	q0!T
+71!D0!@	*H
!10!-10
	`He0\
+7N0L0
+70	010
	`He qGpNyj}sBJ$Yޔ䠂00
aIU0
	*H
0~10	UUS10U
Washington10URedmond10U
Microsoft Corporation1(0&UMicrosoft Code Signing PCA 20100
111010204524Z
130110205524Z010	UUS10U
Washington10URedmond10U
Microsoft Corporation1
0UMOPR10UMicrosoft Corporation0"0
	*H
0
Ϥ01QU4`E)_++rC\;*Yqrx ,8[b}ԯaD9βTK&DOW#Jjة6w4O{_u9}aRƲ~:xȔ=G'rpW0'ca(лbd@"+^wrN|U~\~@6tdW$XkUgZ.i;%00U%0
+0Ui1bqXxa0U#0_{"XrN!t#20VUO0M0KIGEhttp://crl.microsoft.com/pki/crl/products/MicCodSigPCA_2010-07-06.crl0Z+N0L0J+0>http://www.microsoft.com/pki/certs/MicCodSigPCA_2010-07-06.crt0U00
	*H
x[Zm#}u	j'EӒNħe݅JSxA
0 T'Yh8.?iLLx
P:M?+R=Mk&Z\j@K1(|Tp?vY0nm.$X9MRlj[AS{T1
DA~Ri?c2KW8X—@c-mk|+;B+9@"QpA
`&ǩc؅0p0X
aRL0
	*H
010	UUS10U
Washington10URedmond10U
Microsoft Corporation1200U)Microsoft Root Certificate Authority 20100
100706204017Z
250706205017Z0~10	UUS10U
Washington10URedmond10U
Microsoft Corporation1(0&UMicrosoft Code Signing PCA 20100"0
	*H
0
dPyg	LVhDXOv|mE9eҏDe,U}.+A+KnILk‰q͵K̈k:&?4W]I*.ՅY?+t+;FFIfTUbWrg% 4]^(ղcӲȊ&
Y5LR[HwօGj-\`ƴ*[#_Eo73jMjfcx0ϕ00	+70U_{"XrN!t#20	+7
SubCA0U0U00U#0Vˏ\bh=[Κ0VUO0M0KIGEhttp://crl.microsoft.com/pki/crl/products/MicRooCerAut_2010-06-23.crl0Z+N0L0J+0>http://www.microsoft.com/pki/certs/MicRooCerAut_2010-06-23.crt0U 00	+7.00=+1http://www.microsoft.com/PKI/docs/CPS/default.htm0@+042 Legal_Policy_Statement. 0
	*H
tWO){xP"	4*,Ͽ4ہ5oywNaZ#bQEg?<09@!)奡i"tGCS0i% moar,iv=Qۦ9H7amS˧a¿⃫k}(QJQlȷJi~IprGc֢DciFz?!{#-A˿Lﱜ"KInv[Sy=s5<TRGjҎڙg^27uZW¿
-'ӵ^i$gsMOVzRMwOB	
v#Vx"&6ʱnG3bɑ3_q@e"B!%-`7A*a<h`RG@w>SP8f3'9x6N_=GSa=*ג,7Z>@B1V$]Qjy{%qDj#u1000~10	UUS10U
Washington10URedmond10U
Microsoft Corporation1(0&UMicrosoft Code Signing PCA 2010
aIU0
	`He0
*H
	10	*H
	1
+70
+710
+70/	*H
	1" X-`bmɀ(pq-Tr0R
+71D0B SQL Server 2012http://www.microsoft.com/sql0
	*H
^58BRhX?R@	HGzO9LEN$恎fyhfK\^CIF}4ghwF#2-h#a|W`4T	cr/.o~s-QD%GaPPv8Ͼ_p+~U<X4bTK	eAXKxK-νY
hq@a@e
J`￧[*01?/oLfi2et	j9顂0
+710	*H
010	+0**H
	0
+Y
0!0	+|wQ4^z+nBW-O1&"U20120211180807.637Z0010	UUS10U
Washington10URedmond10U
Microsoft Corporation1
0UMOPR1'0%UnCipher DSE ESN:936C-7AEE-74AE1%0#UMicrosoft Time-Stamp Service0q0Y
a	*0
	*H
010	UUS10U
Washington10URedmond10U
Microsoft Corporation1200U)Microsoft Root Certificate Authority 20100
100701213655Z
250701214655Z0|10	UUS10U
Washington10URedmond10U
Microsoft Corporation1&0$UMicrosoft Time-Stamp PCA 20100"0
	*H
0

w: iktTե
|hK,_av>f+[S'1A	|a0Y0D`TCM8Bݓs0W&E
GͿ$`2X`FXG2tag_TϓLĦ]an(aF'$gr!KdPb]w=WuBM@Q>gfD~Knʱz*
1N5x</Dd 	xD]^O"M00	+70Uc:\1C{|F3hZmU0	+7
SubCA0U0U00U#0Vˏ\bh=[Κ0VUO0M0KIGEhttp://crl.microsoft.com/pki/crl/products/MicRooCerAut_2010-06-23.crl0Z+N0L0J+0>http://www.microsoft.com/pki/certs/MicRooCerAut_2010-06-23.crt0U 00	+7.00=+1http://www.microsoft.com/PKI/docs/CPS/default.htm0@+042 Legal_Policy_Statement. 0
	*H
Q
?q=!o1Wm0fjxǨ%kTW+QDS`v@@A\\^5$VKtBȯ7}Z?yJR8/ye٩kzoK0D$"<Y)p2J'U/3b_W@ΙfjbJ&9Jqc{!mÜ<}jxm8ؔƥ
B"8 %d~cY%z.9Wvqa˚Gͧ};q	]t"aڰPo1:eGxHr~akow˧	9؂r*T9[
Uzs;-3.)/T'!ȬN(ۖBAM*f0ӻt2Kc{/!YD<PqסUiW0M
]O8/X.
P5	'ճ~56_tI00
aN	0
	*H
0|10	UUS10U
Washington10URedmond10U
Microsoft Corporation1&0$UMicrosoft Time-Stamp PCA 20100
111215031031Z
130315032031Z010	UUS10U
Washington10URedmond10U
Microsoft Corporation1
0UMOPR1'0%UnCipher DSE ESN:936C-7AEE-74AE1%0#UMicrosoft Time-Stamp Service0"0
	*H
0
ؾc0HS<!%5x~B ?+#^ˀÄRU9U?T<>ǘP5Gj+ἃdPeMsؾHu84YR䇉
;G+	TH9Hkd~"AH6/S4J&)IaʱX&_"
wguaS+ƶwp/%B:2AOTlE{@PFWƀb00U?9v5#[LW70U#0c:\1C{|F3hZmU0VUO0M0KIGEhttp://crl.microsoft.com/pki/crl/products/MicTimStaPCA_2010-07-01.crl0Z+N0L0J+0>http://www.microsoft.com/pki/certs/MicTimStaPCA_2010-07-01.crt0U00U%0
+0
	*H
O)KSQ\\s*8hO9KC54Ud"
`΃;@|D[ifa?ann!ҲgR*ru1>QI̐Ԉ!kbب"pQØ9X=pD.mLsT&cYNOg~u:TePbɂ%=e?cbӉ_ɩVK@TA%X,O㣏)}Wrxnj] PLv0^0㡁010	UUS10U
Washington10URedmond10U
Microsoft Corporation1
0UMOPR1'0%UnCipher DSE ESN:936C-7AEE-74AE1%0#UMicrosoft Time-Stamp Service%
0	+^$3+b xc
ցs적0010	UUS10U
Washington10URedmond10U
Microsoft Corporation1
0UMOPR1'0%UnCipher NTS ESN:B027-C6F8-1D881+0)U"Microsoft Time Source Master Clock0
	*H
ϣ0"20120211112939Z20120212112939Z0t0:
+Y
1,0*0
ϣ000
!#06
+Y
1(0&0
+Y

0 
0 0
	*H
*Aܚ}kpEK)pin_f\P0a:>uѣ{77yX&2pR"V>zi]s^FxB>c3n*dQ9ΤMpEh	Dh-ak8I65΢kvg};du;OJ-(N!vm
cPU\d6F!nkBD$>r;,!D]_H7ı!^"z#|RS5]1000|10	UUS10U
Washington10URedmond10U
Microsoft Corporation1&0$UMicrosoft Time-Stamp PCA 2010
aN	0	+0	*H
	1
*H
	0#	*H
	1JE@s"m2VQvP 0*H
	1000^$3+b xc
ցs00~0|10	UUS10U
Washington10URedmond10U
Microsoft Corporation1&0$UMicrosoft Time-Stamp PCA 2010
aN	0ZǕ.
Ԥ@0
	*H
adFKfܒ*>dAWƖ,)oOmAjX{NuZ\0n,ht3;y*GFQ]ym7k?]zTPX!gP6N%IC(m5g1rgfM-:_Imd	[XsÇYwMl8i~@pr׶0!~8_iqO"^Vvft~A7<d<Ā

Anon7 - 2022
AnonSec Team