> For the complete documentation index, see [llms.txt](https://docs.cybus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cybus.io/1-9-0/documentation/services/service-commissioning-files/sample-service-commissioning-files/machine-utilization-example-multi-file-service-composition-modbus-tcp-+-influxdb-+-grafana-+-mss/machine-utilization-example-push-data-to-mssql-database.md).

# “Machine Utilization Example” - Push data to MSSQL Database

In this file, data is pushed to an MSSQL database.

{% file src="/files/gSnsYxF250ptsSAG049l" %}

{% code title="utilization-push-sql.yml" lineNumbers="true" %}

```yaml
description: >
    Sample MSSQL service commissioning file

metadata:
    name: MSSQL push service
    icon: https://www.cybus.io/wp-content/uploads/2017/10/for-whom1.svg
    provider: cybus
    homepage: https://www.cybus.io
    version: 1.0.0

parameters:
    mssqlHost:
        type: string
        default: 172.17.0.1

    mssqlPort:
        type: integer
        default: 1433

    mssqlUser:
        type: string
        default: sa

    mssqlPassword:
        type: string
        default: SomeLongSecurePassw0rd

    mssqlDatabase:
        type: string
        default: tempdb

resources:
    mssqlDB:
        type: Cybus::Container
        properties:
            image: mcr.microsoft.com/mssql/server
            ports:
                - 1433:1433/tcp
            environment:
                SA_PASSWORD: 'SomeLongSecurePassw0rd'
                ACCEPT_EULA: 'Y'

    mssqlConnection:
        type: Cybus::Connection
        properties:
            protocol: Mssql
            connection:
                host: !ref mssqlHost
                port: !ref mssqlPort
                username: !ref mssqlUser
                password: !ref mssqlPassword
                database: !ref mssqlDatabase

    mssqlQuery2:
        type: Cybus::Endpoint
        properties:
            protocol: Mssql
            connection: !ref mssqlConnection
            write:
                # Here we use the placeholder @someValue. The protocol driver will insert
                # the value from the input JSON message under the key someValue
                query: 'INSERT INTO machine (powerlevel, state, timestamp) VALUES (@powerlevel, @state, @timestamp)'

    mapping:
        type: Cybus::Mapping
        properties:
            mappings:
                - subscribe:
                      topic: 'machine-state'
                  publish:
                      endpoint: !ref mssqlQuery2
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cybus.io/1-9-0/documentation/services/service-commissioning-files/sample-service-commissioning-files/machine-utilization-example-multi-file-service-composition-modbus-tcp-+-influxdb-+-grafana-+-mss/machine-utilization-example-push-data-to-mssql-database.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
