System database configuration in MSSQL 2022

In case you need to store great numbers of SMS text messages it is possible that your system will be slowed down by this amount of stored files. By default, Ozeki NG SMS Gateway stores messages in files. In this way, it is highly recommended to use the System Database option in Ozeki NG SMS Gateway. This option allows you to speed up message sending. On this webpage you find a detailed configuration guide for using System Database in MSSQL 2022.

What is MS SQL SMS

It makes possible to send and receive text messages from/to Microsoft SQL database.

What is Marketing database

In the SMS Marketing database, recipient phone numbers, message texts, send/receive times, and SMS status are stored.

Please note!!!

When you switch to System Database, you can receive an error message since the system cannot find messages.

The reason for this: the system searches for messages still in the file but system database stores them in a database. To avoid this error message please read How to import messages to System Database and How to switch from file to database sections.

Configuration steps

In the follows you can find detailed configuration steps on how you can configure System Database option in Ozeki NG SMS Gateway software. In this example, MSSQL 2022 is used. Please follow the steps below to make your settings effectively.

It is assumed that you have already downloaded, installed and configured Ozeki NG SMS Gateway and MSSQL 2022.

First of all, start SQL server Management Studio (Start menu \ All programs \ Microsoft SQL Server 2022 \ SQL Server Management Studio).

Login as administrator (admin user has been created during the installation of MSSQL Server 2022) (Figure 1).

login window
Figure 1 - Login

Expand Databases menu. Then right click on Databases and click on New Database. In this way, you can create the database that will include the system database of Ozeki NG SMS Gateway. It is recommended to create a new database to avoid confusion (Figure 2).

create a new database
Figure 2 - Create new database

On New Database form specify Database name (in this example, we use ozeki_sys) and click on OK (Figure 3).

name the database
Figure 3 - Database name

Under Databases menu item you can see the created database (Figure 4).

created database
Figure 4 - Created database

Now expand Security menu item. Then right click on Logins and select New login (Figure 5).

new login
Figure 5 - New login

On the appeared form please specify the follows (Figure 6):

  1. Specify Login name: it is the user name (in this example: "ozeki")
  2. Enable SQL Server authentication checkbox and specify the Password.
  3. Disable User must change password at next login checkbox.
  4. Specify Default database (in this example: "ozeki_sys").

specify details
Figure 6 - Specify details

After you have specified the details on New login form, click on User mapping still on the same form (Figure 7).

user mapping
Figure 7 - User mapping

Enable the checkbox of the created database (in this example it is "ozeki_sys") and click on ... button at the end of the row (Figure 8).

enable the database
Figure 8 - Enable the database

On the appeared Select Schema form click on Browse to be able to select the schema you wish to use for the user (Figure 9).

browse button
Figure 9 - Browse

Select the schema you wish to use (in this case dbo schema is needed) and click on OK (Figure 10).

select the schema
Figure 10 - Select the schema

On Figure 11 you can see the selected schema is listed. Click on OK again.

select schema is listed
Figure 11 - Selected schema is listed

You also need to specify Database role membership for the created database (Figure 12). You can do so by selecting the wished items at the bottom of New login form. Please select: db_ddladmin
db_owner
Public is selected by default. Please leave it selected.

Finally, click on OK to create the user.

database role membership
Figure 12 - Database role membership

If you made settings correctly, you can see the created user under Logins menu item (Figure 13). In this example it is "ozeki".

created user
Figure 13 - Created user

Now start Ozeki NG SMS Gateway and login with your username and password (Figure 14).

log into ozeki ng sms gateway
Figure 14 - Log into Ozeki NG SMS Gateway

Go to Edit menu and select Server preferences menu item (Figure 15).

server preferences
Figure 15 - Server preferences

Select Databases tab and click on System database settings tab (Figure 16). Here, enable Use a database server instead of file system to store messages. Database connection type needs to be OleDb.

Then specify the Database connection string as follows:

Provider=SQLOLEDB.1;Data Source=YourComputerName;Persist Security
Info=False;Integrated Security=SSPI;User ID=YourUserName;Password=YourUserPassword;Initial
Catalog=YourDatabaseName

Please customize the Database connection string according to the follows:

YourComputerName= the IP address or domain name of the computer on which the database server has been installed. If the Ozeki NG SMS Gateway and the database server are on the same computer, this value is (local).

YourUserName= username for the database.

YourUserPassword= password belongs to the username.

YourDatabaseName= the catalog or database that you have created for storing the system database. (In this example, it is "ozeki_sys")

Finally, click on OK.

system database settings
Figure 16 - System database settings

Now restart the Ozeki NG service by right clicking on the Ozeki icon on the tray and select Restart service option (Figure 17).

restart service
Figure 17 - Restart service

After restart, go to View menu and select System DB events menu item (Figure 18).

system db events
Figure 18 - System DB events

If the configuration was correct then you can see the following server event: "Database connection successful" (Figure 19).

database connection successful
Figure 19 - Database connection successful

If you send a test message it needs to be appeared in the Sent box in Ozeki NG SMS Gateway as Figure 20 demonstrates.

sent test message
Figure 20 - Sent test message

As a consequence of the test message it can be seen that the database tables containing the messages have been created in the database successfully for the given user (Figure 21).

database table created
Figure 21 - Database tables have been created successfully

What is database sms used for

In the SMS Marketing database stores the recipient phone numbers, the SMS message texts, the sending and receiving times, and the SMS status of the message.

More information