Created
September 5, 2017 14:30
-
-
Save Alexei000/f81c6894e9b7650535c733ca66864326 to your computer and use it in GitHub Desktop.
Object fetch with joins view
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
create view tmp.vwImportingSystemTestResult | |
AS | |
SELECT TR.ImportingSystemTestResultId, TR.EnteredTimestamp, TR.RunTimestamp, TR.ImportingSystemTestId, TR.ImportingSystemId, TR.EnvironmentId, TR.RequesterId, TR.ImportingSystemTestExecutionStatusId, | |
TR.ResultFilename, Q.RequestId, DurationMs, | |
T.TestName, ImpSys.ImportingSystemName, E.Name, U.Username | |
FROM dbo.ImportingSystemTestResult TR | |
JOIN dbo.ImportingSystemTestRunTime TRT ON TRT.ImportingSystemTestResultId = TR.ImportingSystemTestResultId | |
JOIN dbo.ImportingSystemTestQueue Q ON Q.ImportingSystemTestQueueId = TR.ImportingSystemTestQueueId | |
-- names joins | |
JOIN dbo.ImportingSystemTest T ON T.ImportingSystemTestId = TR.ImportingSystemTestId | |
JOIN dbo.ImportingSystem ImpSys ON ImpSys.ImportingSystemId = T.ImportingSystemId | |
JOIN dbo.Environment E ON E.EnvironmentId = TR.EnvironmentId | |
JOIN dbo.AppUser U ON U.AppUserId = TR.RequesterId | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment