# Gateway error when storing authentication info to Microsoft SQL Server Database

**URL:** <https://forum.inductiveautomation.com/t/gateway-error-when-storing-authentication-info-to-microsoft-sql-server-database/52803>\
**Category:** Ignition\
**Created:** [November 6, 2021, 3:57am UTC](https://forum.inductiveautomation.com/t/gateway-error-when-storing-authentication-info-to-microsoft-sql-server-database/52803 "2021-11-06T03:57:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![phandc](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phandc](https://forum.inductiveautomation.com/u/phandc)\
**Post date:** [November 6, 2021, 3:57am UTC](https://forum.inductiveautomation.com/t/gateway-error-when-storing-authentication-info-to-microsoft-sql-server-database/52803/1 "2021-11-06T03:57:51Z")

</div>

Hi everyone,  
I am trying to map all authentication info about users and roles from a database user source to a Microsft SQL Server database following this guide [Database Authentication](https://docs.inductiveautomation.com/display/DOC80/Database+Authentication). I have configured it successfully using SQLite Database. However, when I tried to create a role or a user in a user source using Microsoft SQL Server Database, it triggered some errors. You can see them in the figures below.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f35c45cd1fd3d4b5e964c02de2b7da8ba922ef9d.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/5/b5cba113ddaea9b291b65ed94b8212db3fe40d46.png)

Thank you for your time!

---

<div class="post-metadata">

**Author:** ![phandc](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phandc](https://forum.inductiveautomation.com/u/phandc)\
**Post date:** [November 6, 2021, 4:08pm UTC](https://forum.inductiveautomation.com/t/gateway-error-when-storing-authentication-info-to-microsoft-sql-server-database/52803/2 "2021-11-06T16:08:10Z")

</div>

In addition, I am using SQL Authentication instead of Window Authentication to connect to the SQL Server.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 6, 2021, 4:32pm UTC](https://forum.inductiveautomation.com/t/gateway-error-when-storing-authentication-info-to-microsoft-sql-server-database/52803/3 "2021-11-06T16:32:39Z")

</div>

The queries you defined for this profile may need to have the schema name prefixing the table names for SQL Server.

---

<div class="post-metadata">

**Author:** ![phandc](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phandc](https://forum.inductiveautomation.com/u/phandc)\
**Post date:** [November 6, 2021, 5:06pm UTC](https://forum.inductiveautomation.com/t/gateway-error-when-storing-authentication-info-to-microsoft-sql-server-database/52803/4 "2021-11-06T17:06:10Z")

</div>

Thanks for your support.  
I hope Ignition can manage all authentication info. Therefore, I chose Automatic Mode when I created a user source. I can query data from the same SQL DB in Designer.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/0/b00f310432deaf6e20965f784512fa9068cc724c.png)

The error occurred when I want to create some tables to that database.

---

<div class="post-metadata">

**Author:** ![phandc](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phandc](https://forum.inductiveautomation.com/u/phandc)\
**Post date:** [December 2, 2021, 11:10am UTC](https://forum.inductiveautomation.com/t/gateway-error-when-storing-authentication-info-to-microsoft-sql-server-database/52803/5 "2021-12-02T11:10:48Z")

</div>

@Kevin.Herron I came back to this topic after several days. Finally, I got the answer. I found that because the SQL Authentication account did not have permission to create databases and tables. Therefore, when I chose the automatic mode to create some user/role tables, it triggered the error as I mentioned above. Changing the permission of SQL Authen account helped me solve the problem.
