Microsoft SQL Server Express 2014 is a free, edition of SQL Server this is ideal for learning and developing desktop, web, and small server applications. The database size can be 10 gigabytes in size. SQL Server Express 2014 release includes the full version of SQL Server 2014 Management Studio. We will be using SQL Server 2014 Management Studio (SSMS) to create a database. The SQL Server database will be created so we can connect to it for data acquisition (data logging) from our PLC applications.
Previously we installed SQL Server Express 2014.
Starting SQL Server Management Studio (SSMS)
Open SQL Server 2014 Management Studio (SSMS) by clicking the SSMS icon or START | All Programs | Microsoft SQL Server 2014 | SQL Server 2014 Management Studio
When SSMS starts you have two different ways to sign into the software. You can use Windows Authentication or SQL Server Authentication.
SQL Server Authentication was set up during the server installation.
Enter the login name and password that was set during the installation process. The login name ‘sa’ system administrator is the default. Press ‘Connect’. Notice in the object explorer that it will display the Computer Name, SQL Server instance, and the logged-in person.
SQL Server Management Studio is a graphical user interface. Many of the tasks that you will do with SSMS are point and click. The interface also allows you also to run SQL scripts. The actions that we can do such as create databases and tables can be done with the GUI (graphical user interface) or SQL script. We will be using the GUI way to create a database.
Looking at the Object Explorer, we see that there are several System Databases that are already present during installation.
master – This database stores user accounts, configuration settings and information on all other databases
model – This database is used as a template for all other databases that you create
msdb – The msdb database is used by the SQL Server Agent for configuring alerts, scheduled jobs, etc.
tempdb – This database holds temporary information from SQL Server. It can be temporary tables, stored procedures, etc.
Create a New Database – SQL Server
To create a new database, click on Databases and then right-click the mouse while on Databases. A menu will appear. Select New Database…
The New Database window will now appear.
We will name the database ACC_Db. You will notice in the database files table the logical name will appear.
Scroll to the right in the window to change the Path. This is where the database and log files will reside.
In our case, we will change the path to ‘F:\SQLExpress’
Click OK to now create the new database in the folder location that we specified.
Now we see our new database in SSMS under Databases.
Let’s add a table to our ACC_Db database. Click on Tables under our new database. Right-click the mouse while on Tables and a menu will appear.
Select Table…
On the right side of the screen, you will notice Properties. This is where we can change the parameters of our table. The name of the table defaults to Table_1.
We will make the following changes:
The table name will be Table_ACC
We will have three columns in our table:
Date – Data Type – Date
Number – Data Type – Numeric
Text – Data Type – text
Now save the new table. We can do this by selecting the save icon on the toolbar, using Ctrl+S, or by the main menu File | Save Table_ACC
We have created our database with a table.
The process of creating a database and tables is easily accomplished with the SQL Server 2014 Management Studio. (SSMS) See the above in action with the YouTube video below.
SQL Express 2014 Documentation.
https://msdn.microsoft.com/en-us/sqlserver2014express.aspx
SQL Express 2014 Forum.
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=sqlexpress
Watch on YouTube : Installing SQL Server Express 2014
If you have any questions or need further information please contact me.
Thank you,
Garry
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.
To get this free article, subscribe to my free email newsletter.
Use the information to inform other people how numbering systems work. Sign up now.
The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.