> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinkfish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# mssql

> Microsoft SQL Server queries and schema management

**Server path:** `/mssql` | **Type:** Application | **PCID required:** Yes

## Tools

| Tool                                            | Description                                                                                                                                                                            |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`mssql_get_info`](#mssql_get_info)             | Get Microsoft SQL Server database connection information                                                                                                                               |
| [`mssql_list_tables`](#mssql_list_tables)       | List all tables in the SQL Server database                                                                                                                                             |
| [`mssql_describe_table`](#mssql_describe_table) | Get table structure and column information                                                                                                                                             |
| [`mssql_execute_query`](#mssql_execute_query)   | Execute a SQL query on Microsoft SQL Server. Use ? placeholders for parameterized queries (e.g., "SELECT \* FROM users WHERE id = ? AND status = ?"). Parameters are applied in order. |
| [`mssql_select_data`](#mssql_select_data)       | Select data from a SQL Server table                                                                                                                                                    |
| [`mssql_insert_data`](#mssql_insert_data)       | Insert data into a SQL Server table                                                                                                                                                    |
| [`mssql_update_data`](#mssql_update_data)       | Update data in a SQL Server table                                                                                                                                                      |
| [`mssql_delete_data`](#mssql_delete_data)       | Delete data from a SQL Server table                                                                                                                                                    |
| [`mssql_create_table`](#mssql_create_table)     | Create a new table in SQL Server                                                                                                                                                       |

***

## mssql\_get\_info

Get Microsoft SQL Server database connection information

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      }
    },
    "required": [
      "PCID"
    ]
  }
  ```
</Expandable>

***

## mssql\_list\_tables

List all tables in the SQL Server database

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      }
    },
    "required": [
      "PCID"
    ]
  }
  ```
</Expandable>

***

## mssql\_describe\_table

Get table structure and column information

**Parameters:**

| Parameter | Type   | Required | Default | Description            |
| --------- | ------ | -------- | ------- | ---------------------- |
| `table`   | string | Yes      | —       | Table name to describe |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "table": {
        "type": "string",
        "description": "Table name to describe"
      }
    },
    "required": [
      "PCID",
      "table"
    ]
  }
  ```
</Expandable>

***

## mssql\_execute\_query

Execute a SQL query on Microsoft SQL Server. Use ? placeholders for parameterized queries (e.g., "SELECT \* FROM users WHERE id = ? AND status = ?"). Parameters are applied in order.

**Parameters:**

| Parameter    | Type      | Required | Default | Description                                                                                                |
| ------------ | --------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------- |
| `query`      | string    | Yes      | —       | The SQL query to execute. Use ? as placeholders for parameters (e.g., "SELECT \* FROM users WHERE id = ?") |
| `parameters` | string\[] | No       | —       | Array of parameter values to substitute for ? placeholders in order                                        |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "query": {
        "type": "string",
        "description": "The SQL query to execute. Use ? as placeholders for parameters (e.g., \"SELECT * FROM users WHERE id = ?\")"
      },
      "parameters": {
        "type": "array",
        "items": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "description": "Array of parameter values to substitute for ? placeholders in order"
      }
    },
    "required": [
      "PCID",
      "query"
    ]
  }
  ```
</Expandable>

***

## mssql\_select\_data

Select data from a SQL Server table

**Parameters:**

| Parameter | Type      | Required | Default | Description                                |
| --------- | --------- | -------- | ------- | ------------------------------------------ |
| `table`   | string    | Yes      | —       | Table name                                 |
| `columns` | string\[] | No       | —       | Columns to select (defaults to all)        |
| `where`   | string    | No       | —       | WHERE clause conditions                    |
| `orderBy` | string    | No       | —       | ORDER BY clause                            |
| `limit`   | number    | No       | —       | Number of results (uses TOP in SQL Server) |
| `offset`  | number    | No       | —       | OFFSET for pagination                      |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "table": {
        "type": "string",
        "description": "Table name"
      },
      "columns": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Columns to select (defaults to all)"
      },
      "where": {
        "type": "string",
        "description": "WHERE clause conditions"
      },
      "orderBy": {
        "type": "string",
        "description": "ORDER BY clause"
      },
      "limit": {
        "type": "number",
        "description": "Number of results (uses TOP in SQL Server)"
      },
      "offset": {
        "type": "number",
        "description": "OFFSET for pagination"
      }
    },
    "required": [
      "PCID",
      "table"
    ]
  }
  ```
</Expandable>

***

## mssql\_insert\_data

Insert data into a SQL Server table

**Parameters:**

| Parameter | Type   | Required | Default | Description                                                                             |
| --------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------- |
| `table`   | string | Yes      | —       | Table name                                                                              |
| `data`    | object | Yes      | —       | Data to insert as key-value pairs (supports nested objects and arrays for JSON columns) |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "table": {
        "type": "string",
        "description": "Table name"
      },
      "data": {
        "type": "object",
        "additionalProperties": true,
        "description": "Data to insert as key-value pairs (supports nested objects and arrays for JSON columns)"
      }
    },
    "required": [
      "PCID",
      "table",
      "data"
    ]
  }
  ```
</Expandable>

***

## mssql\_update\_data

Update data in a SQL Server table

**Parameters:**

| Parameter | Type   | Required | Default | Description                                                                             |
| --------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------- |
| `table`   | string | Yes      | —       | Table name                                                                              |
| `data`    | object | Yes      | —       | Data to update as key-value pairs (supports nested objects and arrays for JSON columns) |
| `where`   | string | Yes      | —       | WHERE clause to identify rows to update                                                 |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "table": {
        "type": "string",
        "description": "Table name"
      },
      "data": {
        "type": "object",
        "additionalProperties": true,
        "description": "Data to update as key-value pairs (supports nested objects and arrays for JSON columns)"
      },
      "where": {
        "type": "string",
        "description": "WHERE clause to identify rows to update"
      }
    },
    "required": [
      "PCID",
      "table",
      "data",
      "where"
    ]
  }
  ```
</Expandable>

***

## mssql\_delete\_data

Delete data from a SQL Server table

**Parameters:**

| Parameter | Type   | Required | Default | Description                             |
| --------- | ------ | -------- | ------- | --------------------------------------- |
| `table`   | string | Yes      | —       | Table name                              |
| `where`   | string | Yes      | —       | WHERE clause to identify rows to delete |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "table": {
        "type": "string",
        "description": "Table name"
      },
      "where": {
        "type": "string",
        "description": "WHERE clause to identify rows to delete"
      }
    },
    "required": [
      "PCID",
      "table",
      "where"
    ]
  }
  ```
</Expandable>

***

## mssql\_create\_table

Create a new table in SQL Server

**Parameters:**

| Parameter   | Type      | Required | Default | Description                 |
| ----------- | --------- | -------- | ------- | --------------------------- |
| `tableName` | string    | Yes      | —       | Name of the table to create |
| `columns`   | object\[] | Yes      | —       | Table column definitions    |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "tableName": {
        "type": "string",
        "description": "Name of the table to create"
      },
      "columns": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Column name"
            },
            "type": {
              "type": "string",
              "description": "Column data type (e.g., VARCHAR(255), INT, NVARCHAR(MAX))"
            },
            "nullable": {
              "type": "boolean",
              "default": true,
              "description": "Whether column can be NULL"
            },
            "primaryKey": {
              "type": "boolean",
              "default": false,
              "description": "Whether column is primary key"
            },
            "autoIncrement": {
              "type": "boolean",
              "default": false,
              "description": "Whether column auto-increments (uses IDENTITY)"
            }
          }
        },
        "description": "Table column definitions"
      }
    },
    "required": [
      "PCID",
      "tableName",
      "columns"
    ]
  }
  ```
</Expandable>
