> ## Documentation Index
> Fetch the complete documentation index at: https://projectdiscovery-nuclei-syntax-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Mssql.MSSQLClient

# Class: MSSQLClient

[mssql](/templates/protocols/javascript/modules/mssql).MSSQLClient

Client is a client for MS SQL database.
Internally client uses denisenkom/go-mssqldb driver.

**`Example`**

```javascript
const mssql = require('nuclei/mssql');
const client = new mssql.MSSQLClient;
```

## Table of contents

### Constructors

* [constructor](/templates/protocols/javascript/modules/mssql.MSSQLClient#constructor)

### Methods

* [Connect](/templates/protocols/javascript/modules/mssql.MSSQLClient#connect)
* [ConnectWithDB](/templates/protocols/javascript/modules/mssql.MSSQLClient#connectwithdb)
* [IsMssql](/templates/protocols/javascript/modules/mssql.MSSQLClient#ismssql)

## Constructors

### constructor

• **new MSSQLClient**(): [`MSSQLClient`](/templates/protocols/javascript/modules/mssql.MSSQLClient)

#### Returns

[`MSSQLClient`](/templates/protocols/javascript/modules/mssql.MSSQLClient)

#### Defined in

mssql.ts:16

## Methods

### Connect

▸ **Connect**(`host`, `port`, `username`): `boolean`

Connect connects to MS SQL database using given credentials.
If connection is successful, it returns true.
If connection is unsuccessful, it returns false and error.
The connection is closed after the function returns.

#### Parameters

| Name       | Type     |
| :--------- | :------- |
| `host`     | `string` |
| `port`     | `number` |
| `username` | `string` |

#### Returns

`boolean`

**`Example`**

```javascript
const mssql = require('nuclei/mssql');
const client = new mssql.MSSQLClient;
const connected = client.Connect('acme.com', 1433, 'username', 'password');
```

#### Defined in

mssql.ts:29

***

### ConnectWithDB

▸ **ConnectWithDB**(`host`, `port`, `username`): `boolean`

ConnectWithDB connects to MS SQL database using given credentials and database name.
If connection is successful, it returns true.
If connection is unsuccessful, it returns false and error.
The connection is closed after the function returns.

#### Parameters

| Name       | Type     |
| :--------- | :------- |
| `host`     | `string` |
| `port`     | `number` |
| `username` | `string` |

#### Returns

`boolean`

**`Example`**

```javascript
const mssql = require('nuclei/mssql');
const client = new mssql.MSSQLClient;
const connected = client.ConnectWithDB('acme.com', 1433, 'username', 'password', 'master');
```

#### Defined in

mssql.ts:46

***

### IsMssql

▸ **IsMssql**(`host`, `port`): `boolean`

IsMssql checks if the given host is running MS SQL database.
If the host is running MS SQL database, it returns true.
If the host is not running MS SQL database, it returns false.

#### Parameters

| Name   | Type     |
| :----- | :------- |
| `host` | `string` |
| `port` | `number` |

#### Returns

`boolean`

**`Example`**

```javascript
const mssql = require('nuclei/mssql');
const isMssql = mssql.IsMssql('acme.com', 1433);
```

#### Defined in

mssql.ts:61
