MicrosoftSqlInsert

Execute a Microsoft SQL Insert Statement.

Added in version 1.0.0.

  • Friendly name: MS-SQL Insert

  • Step class: base_steps_syncpack.steps.MicrosoftSqlInsert.MicrosoftSqlInsert

  • Step version: 1.1.1

  • Required parameters: database, host, username, password, port

Parameters

Name

Type

Required

Default

Description

table

string

no

–

The database table name. Example: Users

database

string

yes

–

The database name. Example: database1

host

string

yes

–

The host of the database. Example: host1

username

string

yes

–

The database username. Example: db_user_name

password

string

yes

–

The database password. Example: db_user_password

insert_query

string (long)

no

–

A full INSERT statement. Overrides the ‘data’ parameter. Example: INSERT INTO table_name (column1, column2) VALUES (value1, value2);

data

json

no

–

The data to insert into the database table. Example: {'name': 'Fred Smith', 'address': '2900 Main Street'}

port

number

yes

7706

The port of the database. Example: 8008

Every step also accepts the platform parameters common to all steps – see Platform parameters.

Dependencies

  • Inherits from: MicrosoftSqlInsert -> BaseStep -> Serializable

  • External packages: ipaascommon, ipaascore, six

Behaviour

Connects through the inherited BaseStep.connect_sql_server and runs an INSERT, then commits. Statement resolution matches MySqlInsert: insert_query verbatim (and it must start with insert), otherwise built from data plus table. One or the other is required.

Outputs

None. The step does not call save_data_for_next_step.

Example

{
  "host": "mssql.example.local",
  "port": 1433,
  "database": "ITSM",
  "username": "svc_pf",
  "password": "${config.db_password}",
  "table": "sync_log",
  "data": {"ci_id": "abc123", "synced_at": "2026-08-25T12:00:00Z"}
}

Notes

Warning

port defaults to 7706, which is the SL1 MySQL port — not SQL Server’s 1433. MicrosoftSqlSelect and MicrosoftSqlDescribe both default to 1433, and so does the platform’s own BaseStep.connect_sql_server. This step overrides a correct default with a wrong one, so set port explicitly rather than relying on it.

  • Unlike the MySQL steps, connection handling comes from the platform’s BaseStep.connect_sql_server, not from util.mysql_utils.

API

class base_steps_syncpack.steps.MicrosoftSqlInsert.MicrosoftSqlInsert

Bases: BaseStep

execute()

All logic main logic for executing the step happens here

Returns:

get_connection(host, username, password, database, port)