×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: SQL
Posted by: Trần Hải Quân
Added: Apr 16, 2013 3:15 AM
Views: 1784
Tags: episerver sql
  1. USE [dbBTFGrid30_Test_Core]
  2. GO
  3. /****** Object:  StoredProcedure [dbo].[ntc_updatePublishDate]    Script Date: 04/16/2013 10:14:48 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. -- =============================================
  9. -- Author:              quan.tran
  10. -- Create date: 2013/04/11
  11. -- Description: <Description,,>
  12. -- =============================================
  13. CREATE PROCEDURE [dbo].[ntc_updatePublishDate]
  14. (
  15.         @pageId INT,
  16.         @createdDate DATETIME,
  17.         @startPublishDate DATETIME
  18. )
  19. AS
  20. BEGIN
  21.         -- SET NOCOUNT ON added to prevent extra result sets from
  22.         -- interfering with SELECT statements.
  23.         SET NOCOUNT ON;
  24.  
  25.     -- Insert statements for procedure here
  26.         UPDATE dbo.tblWorkContent SET Created=@createdDate,Saved=@createdDate,StartPublish=@startPublishDate WHERE fkContentID=@pageId
  27.         UPDATE dbo.tblContentLanguage SET Created=@createdDate,Saved=@createdDate,StartPublish=@startPublishDate WHERE fkContentID=@pageId
  28. END
  29. GO
  30. /****** Object:  StoredProcedure [dbo].[ntc_getAllPageDataByDateCreatedDate]    Script Date: 04/16/2013 10:14:48 ******/
  31. SET ANSI_NULLS ON
  32. GO
  33. SET QUOTED_IDENTIFIER ON
  34. GO
  35. -- =============================================
  36. -- Author:              quan.tran
  37. -- Create date: 2013/04/10
  38. -- Description: Get all artcles by created date
  39. -- =============================================
  40. CREATE PROCEDURE [dbo].[ntc_getAllPageDataByDateCreatedDate]
  41. (
  42. @startDate datetime,
  43. @endDate datetime
  44. )
  45. AS
  46. BEGIN
  47. -- SET NOCOUNT ON added to prevent extra result sets from
  48. -- interfering with SELECT statements.
  49. SET NOCOUNT ON;
  50. SELECT
  51.         c.pkID AS PageId,
  52.         wc.pkID AS WorkId,
  53.         wc.Name AS PageName,
  54.         wc.Created AS CreatedDate,
  55.         wc.Saved AS SavedDate,
  56.         wc.StartPublish AS StartPublishDate
  57. FROM tblWorkContent wc
  58. INNER JOIN tblContent c
  59.         ON wc.fkContentID = c.pkID
  60. INNER JOIN tblContentType ct
  61.         ON c.fkContentTypeID = ct.pkID
  62. WHERE ct.Name = 'ArticlePageData' AND wc.CommonDraft = 1
  63.  AND wc.Created >=@startDate AND wc.Created<=@endDate
  64.  ORDER BY wc.Created
  65. END
  66. GO
  67.