Installing and Configuring SQL-server. Creating a database and connect to it TCU-3
In this part of a series of articles describes how to install and configure MS SQL Server 2005, and the creation of a database TCU-3 and connect to it.
An alternative location TCU on the SQL server. Also attached is a video tutorial that shows the complete sequence of actions described in the article.
In the editorial "Network" and "Ultra" TCU supports DBMS companies © Microsoft -
Microsoft SQL Server, as well as its free edition - SQL Server Express Edition, which has some
technical limitations, but quite suitable for conducting software systems across a small company.
Discuss the advantages and disadvantages of using MSSQL to other databases are beyond the scope of this article and will not be given here.
We only note that this is one of the most common management systems relational databases, with its high speed, safety and reliability in multiplayer mode.
Example installation will lead to Windows XP SP3. Links to the distributions shown for 32-bit versions of Windows XP, but on
manufacturer's site you'll find links to the distributions for other variants of the OS - supported by all client and server Windows. In the example, the installation will be carried out free
Editorial SQL-Server - Express Edition. Installing the full version of SQL-server is not fundamentally different and can also be used by you in their activities. Later in the article, if it is not stated separately, the term "MSSQL Server" or simply "SQL Server" will be implied and the commercial version of MSSQL Server 2005 and MSSQL Server 2005 Express Edition at the same time.
To install MS SQL Server 2005 Express Edition, you need:
- Redistributable Package Microsoft. NET Framework 2.0 - link
- Microsoft SQL Server 2005 Express Edition - link
- SQL Server Management Studio Express - link. Before installing SQL Server Management Studio Express may need to install MSXML 6.0. a>
Also additionally be downloaded from the site SoftKB:
- script to create a database TCU-3 - link
- distribution TCU-3 - link
1. Installing Microsoft. NET Framework 2.0
Open distribution package and install the Microsoft. NET Framework 2.0
Fig. 1. Installing Microsoft. NET Framework 2.0
2. Installing Microsoft SQL Server 2005 Express Edition
Open Redistributable Package Microsoft SQL Server 2005 Express Edition and run the installation wizard:
Fig. 2. Installing Microsoft SQL Server 2005 Express Edition
Page, "Feature Selection" (Component Selection) check to install all the items on the list:
Fig. 3. Selection of components
On the "Authentication Mode" (mode authentication), leave the item "Windows Authentication Mode" (mode authentication Windows). Mixed Mode authentication (access to the database by login/password) will be discussed later, in a separate article:
Fig. 4. Windows Authentication Mode
On the "Configuration Options", select "Add user to the SQL Server Administrator role". The first option must also be installed:
Fig. 5. Configuration Options
On the following pages are no options, no need to change, just go step by step wizard by clicking the button "Next". Wait until the end of the wizard:
Fig. 6. Setup Progress
Badges green in paragraphs list and the status of "Setup finished" indicate the successful installation of each component. Complete the wizard.
After installing MSSQL Server is necessary to its configuration - go to Start> All Programs> Microsoft SQL Server 2005> Configuration Tools> SQL Server Configuration Manager.
This console allows you to manage services of SQL Server. In the tree on the left, select the first branch - "SQL Server 2005 Services", in the right pane of the console, right-click on SQL Server Browser on the shortcut menu, select "Properties":
Fig. 7. SQL Server Configuration Manager - service to start
list for the parameter "Start Mode", select from the drop down list value of "Automatic", then click "Apply" and "OK"
Fig. 8. Features: SQL Server Browser
Go to the console to a branch SQL Server Network Configuration> Protocols for SQLEXPRESS ". On the right side, double-click on the line" TCP/IP ":
Fig. 9. SQL Server Network Configuration
list for the parameter "Enabled" from the dropdown list, select the value of "Yes", then click "Apply" and "OK":
Fig. 10. Features: TCP/IP
Following the change requires restart of SQL Server. Go to the console to the thread "SQL Server 2005 Services". In the right pane of the console, right-click on the item "SQL Server (SQLExpress)" and on the shortcut menu select "Restart":
Fig. 11. SQL Server 2005 Services
After restarting the service then start the service "SQL Server Browser" - the shortcut menu, select "Start":
Fig. 12. SQL Server 2005 Services
3. Installing SQL Server Management Studio Express
SQL Server Management Studio Express - a tool for configuration, management and administration of all components of Microsoft SQL Server. The utility includes a script editor and a graphical utility that works with objects and server settings. To install, open the distribution package Microsoft SQL Server Management Studio and run the installation wizard:
Fig. 13. MS SQL Server Management Studio Express Setup
The entire system is to navigate through the steps of the wizard. If necessary, you will need to be further predustanovit
MSXML 6.0., however, as a rule, this component of already estab earlier - see Fig. 6
4. Creating a database TCU-3
Next step is to create a database TCU. In this case there are two ways of creating a database - with the help of a script in SQL Server Management Studio or to convert it from the database format MS Access. The second way to survive not only the structure, but all your data have been previously entered in the database. This method will be discussed in the next article, and now dwell on the creation of a database that has only the necessary structure. Typically, this option is used at the beginning of work and data entry from scratch ".
Go to Start> Microsoft SQL Server 2005> SQL Server Management Studio Express. Please note, looks like the server name (Server name) - SERVER\SQLEXPRESS. The prefix "\SQLEXPRESS" typical SQL Server Express Edition, for the full version of SQL Server, this attachment is absent and the name of SQL server will match the computer name - SERVER. Leave the Mode Authentication - Windows. Click "Connect":
Fig. 14. Connect to SQL Server Express
The left side of the browser, right-click on the branch "Databases" in the shortcut menu, select "New Database":
Fig. 15. SQL Server Management Studio: Object Explorer - New Database
Enter in the field "Database name" (database name) The name of the base, for example, tcu_db and click "OK":
Fig. 16. The new database
The top of the browser, click "New Query". Download archive script to create the database structure TCU-3,
unzip it and open it in Windows Explorer folder containing the file CreateTCUDataBase.sql. Drag and drop the file into the window CreateTCUDataBase.sql SQL Server Management Studio, as shown:
Fig. 17. Opening CreateTCUDataBase.sql
the top of the browser must select the correct database - tcu_db and click "Execute" (Run):
Fig. 18. Performing CreateTCUDataBase.sql
Result of the script should be the creation of tables in the database tcu_db. You should see a message that the operation succeeded, and display the table in the database tcu_db (see the object tree):
Fig. 19. The successful establishment of the database structure
Close SQL Server Management Studio and navigate to the final section of the article.
5. Installing TCU-3 and the connection to the database.
Set TCU-3 from distribution, downloaded from Site SoftKB. After installation is complete, open the program TCU-3.
You will see data on retail outlets, products, customers and others from the demo database from the distribution program. To connect to a new database on SQL server, click on "Directories" - "Options"
Fig. 20. Settings TCU-3
In the Settings section, click links and ways to ">" Change connection ">" MS SQL Server ". Carefully fill in the "Server", "database". In the "Authentication" leave it "Windows Authentication". Again, pay attention to the name server server\sqlexpress. Prefix "\sqlexpress" typical SQL Server Express Edition. With the full version of SQL Server this prefix should not specify the name of SQL server will match the computer name - SERVER
Fig. 21. TCU-3: connection to the database
To double check the correctness of the entered data and click "Test Connection". You should see the message "Test connection was successful."
Then click the "Save connection string" and restart TCU-3. After restarting TCU will reveal details of the new database. Since no data are not there yet (we have created only the structure of the database) it will start filling the master directories. Follow the wizard steps and enter the data into the new database.
TCU-3: master of the initial filling of directories
To facilitate the perception of the material presented recommend to view a video tutorial showing the steps in this article from first to last paragraph.