Last active
June 30, 2016 21:16
-
-
Save jpcaparas/69886fbf2682ff487866f0df38541d3f to your computer and use it in GitHub Desktop.
Sandfield CMS Stored procedures
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
/** | |
Fetch an article based on its ID: | |
Fields required: | |
- Type | |
- Title | |
- Description | |
- Thumbnail | |
- Published time | |
- Modified time | |
- Section/category | |
TODO: On the where clause, specify article ID | |
**/ | |
SELECT | |
[ArticleType].[Name] as ArticleType | |
,[Article].[Title] | |
,[Article].[Description] | |
,[Article].[ThumbnailImage] | |
,[Article].[Created] | |
,[Article].[LastModified] | |
,[ArticleCategory].Name as CategoryName | |
FROM [CMS_SAL_DEV].[CMS].[Article] Article | |
LEFT JOIN [CMS_SAL_DEV].[CMS].[ArticleType] ArticleType | |
ON [Article].[ArticleTypeID] = [ArticleType].[ArticleTypeID] | |
LEFT JOIN [CMS_SAL_DEV].[CMS].[ArticleCategory] ArticleCategory | |
ON [ArticleType].[ArticleTypeID] = [ArticleCategory].[ArticleCategoryID] | |
WHERE [Article].[ArticleID] = 1 | |
ORDER BY [Article].[Created] DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment