> 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-8-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.

Download:

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

{% code 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cybus.io/1-8-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=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
