- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How can I export survey responses directly from SQLserver?
- ldhf5237
- Topic Author
- Offline
- New Member
Less
More
11 years 1 month ago #93961
by ldhf5237
As we know data extraction from Lime Survey is limited. Now I got a requirement from business users to export data from SQLServer directly by running a SQL code. But when I queried in database I found some languages are stored as strange codes in database. How could I export the responses correctly without strange codes?
Many thanks in advance.
How can I export survey responses directly from SQLserver? was created by ldhf5237
As we know data extraction from Lime Survey is limited. Now I got a requirement from business users to export data from SQLServer directly by running a SQL code. But when I queried in database I found some languages are stored as strange codes in database. How could I export the responses correctly without strange codes?
Many thanks in advance.
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
11 years 1 month ago #93966
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic How can I export survey responses directly from SQLserver?
You are not the only one having tried to export data directly via an SQL statement and so far no one has succeeded to do so.
There are several reasons for this, e.g. Limesurvey stores answer codes instead of the full text answers to deal with multi-lingual surveys and thus several sub-queries are needed to get in all in line.
You definitely need a PHP script to do the export the data (and write it into another DB).
There are several reasons for this, e.g. Limesurvey stores answer codes instead of the full text answers to deal with multi-lingual surveys and thus several sub-queries are needed to get in all in line.
You definitely need a PHP script to do the export the data (and write it into another DB).
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: ldhf5237
The topic has been locked.
- tzedan
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 2
6 years 1 week ago #167176
by tzedan
Replied by tzedan on topic How can I export survey responses directly from SQLserver?
I know this topic is old but I reverse engineered the PHP code for getting the answer and created a stored procedure. I have attached my code.
Attachments:
The following user(s) said Thank You: Microchip
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
6 years 1 week ago #167207
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic How can I export survey responses directly from SQLserver?
Thanks for sharing!
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- LouisGac
- Visitor
6 years 1 week ago #167210
by LouisGac
Replied by LouisGac on topic How can I export survey responses directly from SQLserver?
that SQL code ^^
thank you for sharing, you could even create a wiki page for that.
thank you for sharing, you could even create a wiki page for that.
The topic has been locked.
- chromagic
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
4 years 1 week ago #196726
by chromagic
Replied by chromagic on topic How can I export survey responses directly from SQLserver?
By any chance would you have an updated version of your SQL stored procedure? When I execute it is giving me some errors creating the temp table, but I think it could be because I have a newer LimeSurvey Version 3.21.0+191203
For example,
exec [dbo].[p_CreateFieldMap] '621959'
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
Msg 207, Level 16, State 1, Line 1
Invalid column name '621959X1X22SQ001'.
For example,
exec [dbo].[p_CreateFieldMap] '621959'
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
Msg 207, Level 16, State 1, Line 1
Invalid column name '621959X1X22SQ001'.
The topic has been locked.