-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JobStats_60MIN partition switching fix
Fix issue with partition switching for JobStats_60MIN. The previous fix for this issue didn't resolve the problem for existing DBA Dash repository databases. #411
- Loading branch information
1 parent
01762f1
commit 21a70eb
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* Remove partitioning from Switch.JobStats_60MIN table. #411 */ | ||
IF EXISTS( | ||
SELECT 1 | ||
FROM sys.partitions | ||
WHERE object_id = OBJECT_ID('Switch.JobStats_60MIN') | ||
AND index_id IN(0,1) | ||
HAVING COUNT(*) > 1 | ||
) | ||
BEGIN | ||
PRINT 'Remove partitioning from Switch.JobStats_60MIN' | ||
ALTER TABLE [Switch].[JobStats_60MIN] DROP CONSTRAINT [PK_JobStats_60MIN] | ||
ALTER TABLE [Switch].[JobStats_60MIN] ADD CONSTRAINT [PK_JobStats_60MIN] PRIMARY KEY CLUSTERED | ||
( | ||
[InstanceID] ASC, | ||
[job_id] ASC, | ||
[step_id] ASC, | ||
[RunDateTime] ASC | ||
) ON [PRIMARY] | ||
END |