Send a test SMS from MSSQL

This guide explains how you can send an SMS message from your MSSQL database server. The procedure is simple: you need to insert a record into the outgoing database table. The guide will give you the INSERT statement you should use. After the record is inserted, the Ozeki SMS Gateway will update it multiple times to give you information about the status of the message submission procedure.

Video content
1. Insert message into database
2. Send test message

Look at the upcoming screenshots to thoroughly examine the final stage, which is SMS sending.

Sending a test message is good for checking if your connection works properly. You can use the Ozeki SMS Gateway to compose a test message and send it. First you need to open your SQL User, which is using the MS SQL Management tools. You can find all your connection on the “User and application” panel on the right side. Click your SQL User to watch it's details. You can find it with the help of Figure 1.

open database user
Figure 1 - Open Database user

On this next panel, you can execute new SQL statements. To run a code, type it into the filed below the “Execute” button. You can find it with the help of “Figure 2”. We provide you an example code snippet, which send a “HelloWorld” message to the provided number. You can find it on Figure 3. Please modify the code with an existing phone number. You can type in the phone number in the “values” bracket. It should be the first attribute. If you are familiar with SQL, feel free to modulate the code as you like.

insert message to the database table
Figure 2 - Insert message to the database table

If you execute this code (Figure 3), it will send the message “HelloWorld” to the number “+44111223465”. To modify the code, find the “values” bracket, where you can rewrite the text of the message and the receiver’s phone number.

INSERT message record (example):
USE ozeki
INSERT INTO ozekimessageout (receiver,msg,status) values ("+44111223465","Helloworld","Send");
GO
Figure 3 - Copy INSERT statement


On Figure 4, you can see that the connection is working and the Ozeki SMS Gateway communicates with the SQL Database management tool you are using. It will notify you of every event upon happening. If something is not working as intended, you will get more information about the error here. It is important to supervise every occurrence on the connection. If your get no error, that means that your server is working as intended, so you are capable to send messages from the Ozeki SMS Gateway.

the database userss sent folder shows that your message has been sent by ozeki sms gateway
Figure 4 - The Database User's sent folder shows that your message has been sent by Ozeki SMS Gateway

More information