View Issue Details

This bug affects 1 person(s).
 0
IDProjectCategoryView StatusLast Update
03520Bug reportsSurvey takingpublic2009-08-03 09:22
Reporterstryker Assigned Toc_schmitz  
PrioritynormalSeverityblock 
Status closedResolutionfixed 
Product Version1.85+ 
Fixed in Version1.85+ 
Summary03520: MSSQL Syntax error
Description

Activating surveys while using odbc_mssql driver causes the following error.

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'AND'.:SELECT g.gid,g.group_name,count(q.qid) as count from questions as q RIGHT JOIN groups as g ON q.gid=g.gid WHERE g.sid=22248 group by g.gid AND g.language='en' AND q.language='en';

Additional Information

Here is the fix for the error. Open admin/activate.php and scroll down to about line 63. You should see the following code.

$groupquery = "SELECT g.gid,g.group_name,count(q.qid) as count from {$dbprefix}questions as q RIGHT JOIN {$dbprefix}groups as g ON q.gid=g.gid WHERE g.sid=$postsid group by g.gid AND g.language='$baselang' AND q.language='$baselang';";

Below is the fix for it.

$groupquery = "SELECT g.gid,g.group_name,count(q.qid) as count from {$dbprefix}questions as q
RIGHT JOIN {$dbprefix}groups as g ON q.gid=g.gid WHERE g.sid=$postsid AND g.language='$baselang' AND q.language='$baselang' group by g.gid, g.group_name;";

TagsNo tags attached.
Bug heat0
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
Browser
Database type & versionMS SQL Server 2005
Server OS (if known)Windows Server 2003
Webserver software & version (if known)Apache 2.0
PHP VersionPHP 5.2.9

Relationships

duplicate of 03494 closedjcleeland MS SQL syntax error upon survey activation attempt 
duplicate of 03527 closedkadejo Due to SQL bad syntax, survey can not be activated at all under PostgreSQL (any version) 

Users monitoring this issue

There are no users monitoring this issue.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2009-07-28 10:51 stryker New Issue
2009-07-28 10:51 stryker Status new => assigned
2009-07-28 10:51 stryker Assigned To => user372
2009-07-28 10:51 stryker Database & DB-Version => MS SQL Server 2005
2009-07-28 10:51 stryker Operating System (Server) => Windows Server 2003
2009-07-28 10:51 stryker Webserver => Apache 2.0
2009-07-28 10:51 stryker PHP Version => PHP 5.2.9
2009-07-28 11:29 user372 Relationship added duplicate of 03494
2009-07-28 11:45 user372 Assigned To user372 => c_schmitz
2009-07-31 07:18 user372 Relationship added duplicate of 03527
2009-07-31 14:41 c_schmitz Status assigned => resolved
2009-07-31 14:41 c_schmitz Fixed in Version => 1.85+
2009-07-31 14:41 c_schmitz Resolution open => fixed
2009-08-03 09:22 c_schmitz Status resolved => closed
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking