Using a Remote SQL Server Best Practices This article will show the steps to setting up an SQL based survey starting with a new project from scratch. 1. Creating a New SQL Project from scratch a. Creating a New Project b. Using a Remote SQL Database (Optional) c. Finalizing the Project Setup d. Advanced settings for a Mirror Database 2. Distributing an SQL Project 3. How to reduce upload and download times when distributing 1. Creating a New SQL Project from scratch a. Creating a new project Create a new project selecting the questionnaire design file (*.qqs). At the New Project window choose the Database tab or click next. Choose the option to Use a Microsoft SQL Server Database. 1 DIP E 007
Once the details have been entered, test the connection. If there are any issues contact your IT Department to verify the information and SQL Server setup. b. Using a Remote SQL Database (Optional) If you choose to tick the SQL Database is Remote option, another tab will be displayed so that you can enter the information for this local SQL Server. Check the option to Create a local copy (mirror) of the Data. For the server name you can simply enter the word (local) including the brackets. Enter the name of the database and if it has not already been created click the button Create Database Test the connection and save defaults. c. Finalizing the Project Upon clicking Finish you will be prompted to enter the Login ID and password for the remote SQL Server. You will also be prompted to enter the Login Id and password for the local SQL Server. NOTE: Where it says (local), for the remote server it will have the IP address. 2 DIP E 007
Choose the option to save login details, as this login will be prompted a number of times through out Professional Quest. The next step is to determine which database to use, the Live database or the Mirror database. The Live database is a lot slower to work with but allows direct modification to the project data. The mirror database is a lot quicker but does not affect the live data at all, and it cannot be copied to the live data at a later date. The most common reasons for using the Mirror database is for response analysis and report generation and other features that only read the data. The image above shows the selection of the Mirror database and the properties associated with this option. The default settings include loading the data before opening the project only. To increase efficiency in mirroring the database there are options that can be changed if you check Only load selected data and press the button Choose data to load 3 DIP E 007
d. Advanced settings for a Mirror Database You will be asked to enter the Login ID and password for the local SQL Database. To gauge whether you are using the mirror data or the live data, there is a constant message at the top of Professional Quest that reminds you. 2. Distributing an SQL Project It is highly recommended that you distribute an SQL Survey while using the Live database. Distribution of an SQL Project is identical to that of a normal Project, except with login and password prompts. 4 DIP E 007
Upon generating the survey, you will be prompted with the following screen: The options available are the automatic method ( yes ), which will take care of the process but you may experience slower speeds when distributing the survey. This is the recommended method for most users. For more experienced users who have an idea about SQL Servers and the programs associated with it, can choose no which will generate a script file that needs to be manually copied into the SQL Query Anaylzer. This method provides highly increased performance. 3. How to reduce upload and download times when distributing If you decide to choose no and take the manual path a file will be created along with your distribution called questioninfo.sql. To access this file locate the distribution folder for the current project. This can be done by holding down the keys CTRL and I to bring up the File Assistant. 5 DIP E 007
The distribution folders should be displayed. Double clicking the distribution folder will open windows explorer to the directory location. The file questioninfo.sql should be in the root of this folder. Open this file in notepad, and select all of its contents and paste it into the SQL Query Analyzer. Run the script. This particular distribution will now be setup and ready to use via the local SQL Server. 6 DIP E 007