Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

MSSQL Query Error


Go to End


1476 Views

Avatar
Beedubsss

Community Member, 7 Posts

19 July 2016 at 2:41pm

Hi,

I've recently installed this blog module onto a project I'm working on which uses MSSQL as the database. After created the Blog page I get a DB error:

SELECT DISTINCT TOP 15 "PublishDate" IS NULL AS "_SortColumn0", "SiteTree"."ClassName", "SiteTree"."LastEdited", "SiteTree"."Created", "SiteTree"."URLSegment", "SiteTree"."Title", "SiteTree"."MenuTitle", "SiteTree"."Content", "SiteTree"."MetaDescription", "SiteTree"."ExtraMeta", "SiteTree"."ShowInMenus", "SiteTree"."ShowInSearch", "SiteTree"."Sort", "SiteTree"."HasBrokenFile", "SiteTree"."HasBrokenLink", "SiteTree"."ReportClass", "SiteTree"."CanViewType", "SiteTree"."CanEditType", "SiteTree"."Locale", "SiteTree"."DesiredPublishDate", "SiteTree"."DesiredUnPublishDate", "SiteTree"."PublishOnDate", "SiteTree"."UnPublishOnDate", "SiteTree"."ProvideComments", "SiteTree"."ModerationRequired", "SiteTree"."CommentsRequireLogin", "SiteTree"."InheritSideBar", "SiteTree"."PublicHistory", "SiteTree"."ShareTokenSalt", "SiteTree"."ContentReviewType", "SiteTree"."ReviewPeriodDays", "SiteTree"."NextReviewDate", "SiteTree"."LastEditedByName", "SiteTree"."OwnerNames", "SiteTree"."Version", "SiteTree"."SubsiteID", "SiteTree"."PublishJobID", "SiteTree"."UnPublishJobID", "SiteTree"."WorkflowDefinitionID", "SiteTree"."SideBarID", "SiteTree"."ParentID", "BlogPost"."PublishDate", "BlogPost"."AuthorNames", "BlogPost"."Summary", "BlogPost"."FeaturedImageID", "SiteTree"."ID", CASE WHEN "SiteTree"."ClassName" IS NOT NULL THEN "SiteTree"."ClassName" ELSE N'SiteTree' END AS "RecordClassName" FROM "SiteTree" LEFT JOIN "BlogPost" ON "BlogPost"."ID" = "SiteTree"."ID" WHERE ("SiteTree"."ParentID" = ?) AND ("SiteTree"."ClassName" IN (?, ?)) AND ("SiteTree"."ClassName" IN (?, ?)) AND ("SiteTree"."SubsiteID" IN (0)) AND ("SiteTree"."Locale" = 'en_NZ') ORDER BY "_SortColumn0" DESC, "PublishDate" DESC 42000, 156

The syntax generated isn't correct but I was wondering if anyone else has experienced any issues with running this module on MS SQL, I am using the CWP recipe as well.

Cheers