Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Survey activation failed due to database error

  • limepl
  • limepl's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 weeks ago #213989 by limepl
Hello,

LimeSurvey:3.25.19 210323apache 2.4 (Linux)
php 7.4.16
MSSQL 2019 ("15.00.2080"), "DriverName": "libmsodbcsql-17.7.so.1.1", "DriverODBCVer": "03.52"

Attempt to activate survey ends with sql error

SQL: SQLSTATE[42S01]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]There is already an object named 'lime_survey_296632' in the database.. The SQL statement executed was: CREATE TABLE [lime_survey_296632] (
[id] int IDENTITY PRIMARY KEY NOT NULL,
[token] nvarchar(35) COLLATE SQL_Latin1_General_CP1_CS_AS NULL,
[submitdate] datetime NULL,
[lastpage] int NULL,
[startlanguage] nvarchar(20) NOT NULL,
[seed] nvarchar(31) NULL,
[296632X9X11] nvarchar(1) NULL,
[296632X9X14] nvarchar(1) NULL,
[296632X9X10SQ001] nvarchar(5) NULL,
[296632X9X10SQ002] nvarchar(5) NULL,
[296632X9X10SQ003] nvarchar(5) NULL,
[296632X9X10SQ004] nvarchar(5) NULL,
[296632X9X10SQ005] nvarchar(5) NULL,
[296632X9X12] decimal (30,10) NULL,
[296632X9X13] nvarchar(1) NULL,
[296632X9X15] nvarchar(1) NULL,
[296632X9X16] nvarchar(max) NULL,
[296632X9X17] nvarchar(1) NULL,
[296632X9X18] nvarchar(1) NULL
)

Some survey activation works fine. Some don't. No additional errors with debuglog on.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 weeks ago #214054 by DenisChenu
Replied by DenisChenu on topic Survey activation failed due to database error
Seems you there are an issue when survey was deactivated previously.

I have such issue in some of mly setup with one of my broken plugin.

I add this
Code:
if($survey->getHasResponsesTable()){
$survey->active = 'Y';
$survey->save();
$aData['aSurveysettings']['active'] = 'Y';
}

At this line : github.com/LimeSurvey/LimeSurvey/blob/9b...surveyadmin.php#L845

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: limepl
The topic has been locked.
  • limepl
  • limepl's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 weeks ago #214286 by limepl
Survey activation worked. Thank you.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose