---
title: Microsoft SQL Server (MSSQL) Configuration
slug: kron-dam-supported-databases-and-databases-clients/microsoft-sql-server-mssql-configuration
docTags: 
createdAt: 2025-01-14T09:03:08.589Z
---

### Purpose&#x20;

In MSSQL, the aim is to create a login and user with minimal read privileges, such as VIEW SERVER STATE, and optionally the ability to view object definitions if required.&#x20;

### Grant Permissions&#x20;

:::CodeblockTabs
MSSQL

```sql
CREATE LOGIN [ username ] WITH PASSWORD = ’<password >’;

GRANT VIEW SERVER STATE TO [ username ];

CREATE USER [ username ] FROM LOGIN [ username ]; -- Under each database that will be connected to.
```
:::

### Testing Permissions&#x20;

Connect as \[username] and execute:&#x20;

```sql
SELECT * FROM sys . dm_os_sys_info ;
```

If \[username] can see the system info, it confirms that VIEW SERVER STATE is functioning correctly.&#x20;
