InsertSMS (view)
The InsertSms view is used to quickly and easily schedule new SMS messages for sending.
For example:
INSERT INTO InsertSms (StatusID, ToAddress, Body)
VALUES (N'SCHEDULED', N'+3112345678', N'Hello, World')
This sends an SMS message to +3112345678 using the first available outgoing SMS channel.
Find out more about how to use these Insert tables here.
The table below provides an overview of all properties that are available to set or select:
| Field | Type | Description |
| ID | int | Message ID |
| DirectionID | nvarchar(32) | Message direction |
| TypeID | nvarchar(32) | SMS, EMAIL, FILE or SMPPSERVERBIND |
| StatusID | nvarchar(32) | Message status |
| StatusDetailsID | int | User field |
| TriggerStatusID | nvarchar(32) | Trigger status |
| TriggerDetailsID | int | User field |
| AckStatusID | nvarchar(32) | Acknowledge status |
| ChannelID | nvarchar(32) | Channel ID of the channel that sent or received the message |
| BillingID | nvarchar(255) | Billing ID used for accounting |
| ScheduledTime | datetime2 | Time when the message is scheduled to be sent |
| SentTime | datetime2 | Time when the message was sent |
| ReceivedTime | datetime2 | Time when the message was received |
| LastUpdate | datetime2 | Time when the message record was last updated |
| Priority | int | Message priority |
| BatchID | int | User field |
| ConversationID | int | User field |
| Hash | nvarchar(100) | Hash of the message used by some channels |
| Creator | nvarchar(32) | Creator of the message |
| Archive | bit | System field |
| CustomField1 | int | User field |
| CustomField2 | nvarchar(255) | User field |
| Trace | nvarchar(max) | Trace of the current message |
| ToAddress | nvarchar(32) | SMS recipient address |
| ToAddressTon | int | To address TON (Type of Number) |
| ToAddressNpi | int | To address NPI (Number Plan Indicator) |
| FromAddress | nvarchar(32) | Sender address or SMS originator |
| FromAddressTon | int | From address TON (Type of Number) |
| FromAddressNpi | int | From address NPI (Number Plan Indicator) |
| RequestDeliveryReport | bit | Whether to request a delivery report |
| IsDeliveryReport | bit | Whether this SMS is a delivery report |
| DeliveryStatus | nvarchar(32) | Delivery status of an SMS |
| ValidityPeriod | int | Validity period in minutes |
| DataCoding | int | Message encoding |
| LanguageLockingShift | int | Locking shift table |
| LanguageSingleShift | int | Single shift table |
| BodyFormat | int | SMS body format |
| HasUdh | bit | True if the SMS has a User Data Header (UDH) |
| TotalParts | int | Total number of parts of the SMS |
| PartNumber | int | Part number of the SMS |
| MultipartReference | int | Multipart reference |
| GsmSmscAddress | nvarchar(32) | GSM SMSC address |
| GsmSmscAddressTon | int | GSM SMSC TON |
| GsmSmscAddressNpi | int | GSM SMSC NPI |
| SmppPriority | int | SMPP priority |
| SmppStatusCode | int | SMPP status code |
| SmppServiceType | nvarchar(32) | SMPP service type |
| SmppClient | nvarchar(64) | SMPP client ID |
| SmppSequenceNumber | int | SMPP sequence number |
| SmppTlvs | nvarchar(max) | SMPP TLV values |
| Body | nvarchar(max) | SMS message body |
| Reference | nvarchar(max) | Provider specific message reference |