Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tables\code so that were not using Guid indexes unless neccessary
- Loading branch information
Showing
44 changed files
with
415 additions
and
387 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
WITH CTE | ||
AS | ||
( | ||
SELECT | ||
Id, | ||
CASE UserOrRoleName | ||
WHEN '*AU' THEN 1 | ||
WHEN '*AAU' THEN 2 | ||
WHEN '*AUU' THEN 3 | ||
ELSE 0 END as SpecialRole, | ||
CASE WHEN UserOrRoleName not like '*%' AND UserOrRole = 'U' THEN UserOrRoleName ELSE null END as PersonGuid, | ||
CASE WHEN UserOrRoleName not like '*%' AND UserOrRole = 'R' THEN UserOrRoleName ELSE null END as GroupGuid | ||
from cmsAuth | ||
) | ||
|
||
UPDATE A SET | ||
SpecialRole = CTE.SpecialRole, | ||
PersonId = P.Id, | ||
GroupId = G.Id | ||
FROM CTE | ||
INNER JOIN cmsAuth A | ||
ON A.Id = CTE.Id | ||
LEFT OUTER JOIN crmPerson P | ||
ON P.Guid = CTE.PersonGuid | ||
LEFT OUTER JOIN GroupsGroup G | ||
ON G.Guid = CTE.GroupGuid | ||
|
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.