# Complex MsSql To File

Runs a complex SQL query and writes the result to a file.


---

### :arrow_left:**INPUT**

| **Parameter** | **Type** | **Required** | **Description** |
|-----------|------|----------|-------------|
| `ConnectionSettings` | [`PAWMsSqlConnectionSettings`](/doc/pawmssqlconnectionsettings-sPYSdWCaH8) | ✅Yes     | Connection information |
| `Query`   | `String` | ✅Yes     | The desired query statement. |
| `OutputFilePath` | `String` | ✅Yes     | File path of the file the data is to be saved to. |


---

### :arrow_right:**OUTPUT**

| **Parameter** | **Type** | **Description** |
|-----------|------|-------------|
| `IsComplexMySqlToFileSuccessful` | `Boolean` | Returns "**True**" if the operation succeeds, "**False**" if it fails. |
| `ComplexMySqlToFileMessage` | `String` | Returns the error information received if the operation fails. |


---

### :arrow_down:**MISC**

| **Parameter** | **Type** | **Default** | **Description** |
|-----------|------|---------|-------------|
| `ThrowException` | `Boolean` | ❌No     | Specifies whether an exception is thrown when the operation fails. The default value is "**No**". |