> For the complete documentation index, see [llms.txt](https://doc.telosys.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.telosys.org/project-databases/sql-server-database.md).

# SQL Server database

## Telosys database configuration

Below are examples of typical configurations for a **SQL Server** database.

### Since Telosys 4.3

```yaml
  - id: sqlsrv
    name: SQL Server database 
    type: SQLSERVER
    # JDBC configuration
    url: jdbc:sqlserver://localhost:1433;databaseName=MyDB
    user: john_doe
    password: not_to_reveal
    # Metadata parameters
    schema: cars
```

### Before Telosys 4.3

```yaml
  - id: sqlsrv
    name: SQL Server database 
    type: SQLSERVER
    # JDBC configuration
    driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
    url: jdbc:sqlserver://localhost:1433;databaseName=MyDB
    user: john_doe
    password: not_to_reveal
    # Metadata parameters
    catalog: '!'
    schema: cars
    tableNamePattern: '%'
    tableTypes: TABLE    
```

### Other JDBC URL examples

```
jdbc:sqlserver://localhost:1433;databaseName=TestDB;encrypt=true;trustServerCertificate=true;

```

### JDBC driver

* Download:
  * Web site:  <https://learn.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server>&#x20;
  * MVN Repository: <https://mvnrepository.com/search?q=mssql-jdbc>&#x20;
* JAR file examples : &#x20;
  * mssql-jdbc-13.2.1.jre8.jar&#x20;
  * mssql-jdbc-13.2.1.jre11.jar
* Driver class name : **com.microsoft.sqlserver.jdbc.SQLServerDriver**&#x20;

## Technical information about SQL Server

### Structure

Server (instance) → **Database** → **Schema** → Tables/Objects&#x20;

<div align="left"><figure><img src="/files/m1MXrLNvagQBJ20GhjyA" alt="" width="287"><figcaption></figcaption></figure></div>

* **Database**: A physical database (similar to PostgreSQL). You must connect to a specific database. Each database is isolated, though cross-database queries are possible (`db1.dbo.table1`).
* **Schema**: A namespace *within a database*. Default schema is usually `dbo`. Users can own schemas, and schemas provide organizational and security boundaries.


---

# 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:

```
GET https://doc.telosys.org/project-databases/sql-server-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
