Microsoft SQL Server

App · Databases · 20 actions

Query and change data in Microsoft SQL Server and Azure SQL: run T-SQL with safe parameters, call stored procedures, select, insert, update, upsert and delete rows without writing SQL, create and drop tables, and look up schemas, tables, columns and indexes.

Actions

ActionWhat it does
Count rowsHow many rows in a table match the given values.
Create tableCreate a table from a list of columns.
Delete rowsRemove the rows matching the given values.
Drop tableDelete a table and every row in it.
Get server infoThe server's edition and version, the connected database and the login in use.
Insert rowAdd one row to a table and get back its new identity value, if the table has an identity column.
Insert rowsAdd up to 1,000 rows in one go, all or nothing.
List columnsA table's or view's columns in order, with type, length, nullability and default.
List databasesThe databases the login can see, with state and recovery model.
List indexesA table's indexes with their key and included columns, and its primary key columns.
List schemasThe schemas in the connected database.
List stored proceduresThe database's own stored procedures, optionally with each one's parameters.
List tablesThe tables the login can see, optionally in one schema.
List viewsThe views the login can see, optionally in one schema.
Run queryRun a T-SQL query and return its rows.
Run statementRun an INSERT, UPDATE, DELETE, MERGE or DDL statement (such as CREATE VIEW) and get the number of rows it changed.
Run stored procedureRun a stored procedure with named arguments and return every result set it produces plus its return value.
Select rowsRead rows from a table without writing SQL: choose columns, match on values, sort and page.
Update rowsChange columns on the rows matching the given values.
Upsert rowUpdate the row with the same key, or insert it if there is none.

Count rows

How many rows in a table match the given values.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
Match rows wherefiltersobject
Column and value pairs every row must equal, e.g. {"status": "active"}. A list matches any of its values; null matches empty.

Outputs

countnumber
tabletext
Example output
{
  "count": 42,
  "table": "dbo.Customers"
}

Create table

Create a table from a list of columns. By default an existing table of that name is left alone.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
ColumnscolumnslistRequired
One entry per column, written as name then type, e.g. 'id int identity primary key', 'email nvarchar(255) not null', 'amount decimal(10,2)'. Types: bigint, int, smallint, tinyint, bit, decimal, numeric, money, smallmoney, float, real, date, time, datetime2, datetimeoffset, datetime, smalldatetime, char, varchar, nchar, nvarchar, binary, varbinary, uniqueidentifier, xml.
Skip if it existsif_not_existstrue/false
Leave an existing table alone instead of failing.Default: true.

Outputs

createdtrue/false
tabletext
Example output
{
  "created": true,
  "table": "dbo.Customers"
}

Delete rows

Remove the rows matching the given values. At least one match is required.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
Match rows wherefiltersobjectRequired
Column and value pairs every row must equal, e.g. {"id": 42}. Required, so the whole table can never be changed by accident.

Outputs

rows_affectednumber
tabletext
Example output
{
  "rows_affected": 1,
  "table": "dbo.Customers"
}

Drop table

Delete a table and every row in it. This cannot be undone.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
Ignore if missingif_existstrue/false
Succeed without doing anything if it is not there.Default: true.

Outputs

droppedtrue/false
tabletext
Example output
{
  "dropped": true,
  "table": "dbo.Customers"
}

Get server info

The server's edition and version, the connected database and the login in use. The quickest way to check the connection.

Inputs

None.

Outputs

collationtext
database_nametext
editiontext
engine_editionnumber
engine_edition_nametext
login_nametext
product_leveltext
product_versiontext
server_nametext
version_stringtext
Example output
{
  "collation": "SQL_Latin1_General_CP1_CI_AS",
  "database_name": "mydatabase",
  "edition": "SQL Azure",
  "engine_edition": 5,
  "engine_edition_name": "SQL Database",
  "login_name": "sqladmin",
  "product_level": "RTM",
  "product_version": "12.0.2000.8",
  "server_name": "myserver",
  "version_string": "Microsoft SQL Azure (RTM) - 12.0.2000.8"
}

Insert row

Add one row to a table and get back its new identity value, if the table has an identity column.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
ValuesvaluesobjectRequired
Column and value pairs, e.g. {"name": "Ada", "email": "ada@example.com"}. Leave out identity and default columns.

Outputs

identitynumber
rows_affectednumber
tabletext
Example output
{
  "identity": 43,
  "rows_affected": 1,
  "table": "dbo.Customers"
}

Insert rows

Add up to 1,000 rows in one go, all or nothing. A column missing from a row is stored as null.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
RowsrowslistRequired
A list of rows, each a column and value object, e.g. [{"name": "Ada"}, {"name": "Grace"}].

Outputs

rows_affectednumber
tabletext
Example output
{
  "rows_affected": 2,
  "table": "dbo.Customers"
}

List columns

A table's or view's columns in order, with type, length, nullability and default.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.

Outputs

columnslist
countnumber
tabletext
Example output
{
  "columns": [
    {
      "character_maximum_length": null,
      "collation_name": null,
      "column_default": null,
      "column_name": "id",
      "data_type": "int",
      "datetime_precision": null,
      "is_nullable": false,
      "numeric_precision": 10,
      "numeric_scale": 0,
      "ordinal_position": 1
    }
  ],
  "count": 1,
  "table": "dbo.Customers"
}

List databases

The databases the login can see, with state and recovery model. On Azure SQL Database this is the connected database and master only.

Inputs

None.

Outputs

countnumber
databaseslist
Example output
{
  "count": 1,
  "databases": [
    {
      "collation_name": "SQL_Latin1_General_CP1_CI_AS",
      "compatibility_level": 170,
      "create_date": "2026-09-01T10:00:00",
      "database_id": 5,
      "is_read_only": false,
      "name": "mydatabase",
      "recovery_model_desc": "FULL",
      "state_desc": "ONLINE",
      "user_access_desc": "MULTI_USER"
    }
  ]
}

List indexes

A table's indexes with their key and included columns, and its primary key columns.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.

Outputs

countnumber
indexeslist
primary_key_columnslist
tabletext
Example output
{
  "count": 1,
  "indexes": [
    {
      "filter_definition": null,
      "has_filter": false,
      "included_columns": [],
      "index_id": 1,
      "is_disabled": false,
      "is_primary_key": true,
      "is_unique": true,
      "is_unique_constraint": false,
      "key_columns": [
        {
          "column": "id",
          "descending": false
        }
      ],
      "name": "PK_Customers",
      "type_desc": "CLUSTERED"
    }
  ],
  "primary_key_columns": [
    "id"
  ],
  "table": "dbo.Customers"
}

List schemas

The schemas in the connected database.

Inputs

Include system schemasinclude_systemtrue/false
Also list sys, INFORMATION_SCHEMA and the db_ roles.Default: false.

Outputs

countnumber
schemaslist
Example output
{
  "count": 1,
  "schemas": [
    {
      "catalog_name": "mydatabase",
      "schema_name": "dbo",
      "schema_owner": "dbo"
    }
  ]
}

List stored procedures

The database's own stored procedures, optionally with each one's parameters.

Inputs

Schemaschematext
Only this schema. Leave empty for every schema.
Include parametersinclude_parameterstrue/false
Also list each procedure's parameters and types.Default: false.

Outputs

countnumber
procedureslist
Example output
{
  "count": 1,
  "procedures": [
    {
      "create_date": "2026-09-01T10:00:00",
      "modify_date": "2026-09-01T10:00:00",
      "name": "usp_GetCustomer",
      "object_id": 581577110,
      "schema_name": "dbo",
      "type": "P",
      "type_desc": "SQL_STORED_PROCEDURE"
    }
  ]
}

List tables

The tables the login can see, optionally in one schema.

Inputs

Schemaschematext
Only this schema. Leave empty for every schema.

Outputs

countnumber
tableslist
Example output
{
  "count": 1,
  "tables": [
    {
      "table_catalog": "mydatabase",
      "table_name": "Customers",
      "table_schema": "dbo",
      "table_type": "BASE TABLE"
    }
  ]
}

List views

The views the login can see, optionally in one schema.

Inputs

Schemaschematext
Only this schema. Leave empty for every schema.

Outputs

countnumber
viewslist
Example output
{
  "count": 1,
  "views": [
    {
      "table_catalog": "mydatabase",
      "table_name": "ActiveCustomers",
      "table_schema": "dbo",
      "table_type": "VIEW"
    }
  ]
}

Run query

Run a T-SQL query and return its rows. Use %(name)s placeholders with 'Parameters' for any value that comes from data. The login's permissions decide what it can touch.

Inputs

SQL queryquerytextRequired
The T-SQL to run, e.g. SELECT * FROM dbo.Customers WHERE status = %(status)s.
Parametersparametersobject
Values for each %(name)s in the SQL, e.g. {"status": "active"} for WHERE status = %(status)s. Passing values here, not pasting them into the SQL, keeps a quote in the data from changing the statement.
Maximum rowsmax_rowsnumber
Return at most this many rows.From 1 to 10000. Default: 1000.

Outputs

columnslist
Column names, in order
row_countnumber
Rows returned
rowslist
The rows, each keyed by column
rows_affectednumber
Rows changed, when the batch changed data
truncatedtrue/false
True when more rows existed than the limit allowed
Example output
{
  "columns": [
    "id",
    "name",
    "email"
  ],
  "row_count": 1,
  "rows": [
    {
      "email": "ada@example.com",
      "id": 1,
      "name": "Ada Lovelace"
    }
  ],
  "rows_affected": -1,
  "truncated": false
}

Run statement

Run an INSERT, UPDATE, DELETE, MERGE or DDL statement (such as CREATE VIEW) and get the number of rows it changed. Use %(name)s placeholders with 'Parameters' for values.

Inputs

SQL statementstatementtextRequired
The T-SQL to run.
Parametersparametersobject
Values for each %(name)s in the SQL, e.g. {"status": "active"} for WHERE status = %(status)s. Passing values here, not pasting them into the SQL, keeps a quote in the data from changing the statement.

Outputs

rows_affectednumber
Example output
{
  "rows_affected": 1
}

Run stored procedure

Run a stored procedure with named arguments and return every result set it produces plus its return value.

Inputs

ProcedureproceduretextRequired
The procedure's name, e.g. usp_GetCustomer. Use 'List stored procedures' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
Argumentsparametersobject
Argument names and values, e.g. {"@customer_id": 42}. The @ is optional.
Maximum rowsmax_rowsnumber
Return at most this many rows.From 1 to 10000. Default: 1000.

Outputs

proceduretext
result_set_countnumber
result_setslist
return_valuenumber
Example output
{
  "procedure": "dbo.usp_GetCustomer",
  "result_set_count": 1,
  "result_sets": [
    {
      "columns": [
        "id",
        "name",
        "email"
      ],
      "row_count": 1,
      "rows": [
        {
          "email": "ada@example.com",
          "id": 1,
          "name": "Ada Lovelace"
        }
      ],
      "truncated": false
    }
  ],
  "return_value": 0
}

Select rows

Read rows from a table without writing SQL: choose columns, match on values, sort and page. A limit always applies.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
Columnscolumnslist
Columns to return. Leave empty for all.
Match rows wherefiltersobject
Column and value pairs every row must equal, e.g. {"status": "active"}. A list matches any of its values; null matches empty.
Sort by columnorder_bytext
Column to sort on. Leave empty for no order.
Sort directionsort_directiontext
Which way to sort, when a sort column is given.One of: ASC (Ascending), DESC (Descending). Default: ASC.
Maximum rowslimitnumber
Return at most this many rows.From 1 to 10000. Default: 100.
Skip rowsoffsetnumber
Skip this many rows first, for paging. Set a sort column too, or the pages may overlap.From 0 to 100000000. Default: 0.

Outputs

columnslist
Column names, in order
row_countnumber
Rows returned
rowslist
The rows, each keyed by column
tabletext
schema.table
truncatedtrue/false
True when more rows existed than the limit allowed
Example output
{
  "columns": [
    "id",
    "name",
    "email"
  ],
  "row_count": 1,
  "rows": [
    {
      "email": "ada@example.com",
      "id": 1,
      "name": "Ada Lovelace"
    }
  ],
  "table": "dbo.Customers",
  "truncated": false
}

Update rows

Change columns on the rows matching the given values. At least one match is required.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
New valuesvaluesobjectRequired
Column and value pairs to set, e.g. {"status": "inactive"}.
Match rows wherefiltersobjectRequired
Column and value pairs every row must equal, e.g. {"id": 42}. Required, so the whole table can never be changed by accident.

Outputs

rows_affectednumber
tabletext
Example output
{
  "rows_affected": 1,
  "table": "dbo.Customers"
}

Upsert row

Update the row with the same key, or insert it if there is none. The key defaults to the table's primary key.

Inputs

TabletabletextRequired
The table's name, e.g. Customers (or sales.Customers to name the schema too). Use 'List tables' to find one.
Schemaschematext
The table's schema. Most tables are in dbo.Default: dbo.
ValuesvaluesobjectRequired
Column and value pairs for the row, including its key, e.g. {"email": "ada@example.com", "name": "Ada"}.
Match on columnskey_columnslist
The columns that identify the row. Leave empty to use the primary key.

Outputs

actiontext
key_columnslist
rows_affectednumber
tabletext
Example output
{
  "action": "UPDATE",
  "key_columns": [
    "id"
  ],
  "rows_affected": 1,
  "table": "dbo.Customers"
}

On this page