# How do I login to my local SQL Server database?

**URL:** <https://community.auth0.com/t/how-do-i-login-to-my-local-sql-server-database/90739>\
**Category:** Get Help\
**Tags:** login, auth0\
**Created:** [September 15, 2022, 8:50pm UTC](https://community.auth0.com/t/how-do-i-login-to-my-local-sql-server-database/90739 "2022-09-15T20:50:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin9](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/martin9/32/33197_2.png) [@martin9](https://community.auth0.com/u/martin9)\
**Post date:** [September 15, 2022, 8:50pm UTC](https://community.auth0.com/t/how-do-i-login-to-my-local-sql-server-database/90739/1 "2022-09-15T20:50:27Z")

</div>

I have a local database (SQL Server) and I want to connect to it to do the login validations to my app, I even followed the example provided by Auth0 but it doesn’t connect and it only says “Request to Webtask exceeded allowed execution time”, and it doesn’t I understand what the problem is because even adding the connection parameters wrong gives me the same message, it’s as if it doesn’t matter that my connection data is wrong, it still gives me the same error, I leave my code in case there is something wrong I contemplated:

function login(email, password, callback) {  
const bcrypt = require(‘bcrypt’);  
const sqlserver = require(‘mssql’);

const Connection = sqlserver.Connection;  
const Request = sqlserver.Request;  
const TYPES = sqlserver.TYPES;

const connection = new Connection({  
userName: ‘sa’,  
password: ‘12345’,  
server: ‘DESKTOP-XXXX\SQLEXPRESS’, #I already tried with localhost and with the ip  
options: {  
database: ‘pruebaDj’  
}  
});

const query = ‘SELECT id, nombreUsuario, Email, pwd FROM dbo.Login\_nuevousuario WHERE Email = @Email’;

connection.on(‘debug’, function (text) {  
console.log(text);  
}).on(‘errorMessage’, function (text) {  
console.log(JSON.stringify(text, null, 2));  
}).on(‘infoMessage’, function (text) {  
console.log(JSON.stringify(text, null, 2));  
});

connection.on(‘connect’, function (err) {  
if (err) return callback(err);  
const request = new Request(query, function (err, rowCount, rows) {  
if (err || rowCount \< 1) return callback(err || new WrongUsernameOrPasswordError(email));  
bcrypt.compare(password, rows[0][3].value, function (err, isValid) {  
if (err || !isValid) return callback(err || new WrongUsernameOrPasswordError(email));  
callback(null, {  
user\_id: rows[0][0].value,  
nickname: rows[0][1].value,  
email: rows[0][2].value  
});  
});  
});  
request.addParameter(‘Email’, TYPES.VarChar, email);  
connection.execSql(request);  
});  
}

---

<div class="post-metadata">

**Author:** ![vlad.murarasu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vlad.murarasu/32/72793_2.png) [@vlad.murarasu](https://community.auth0.com/u/vlad.murarasu)\
**Post date:** [February 26, 2025, 6:03pm UTC](https://community.auth0.com/t/how-do-i-login-to-my-local-sql-server-database/90739/3 "2025-02-26T18:03:47Z")

</div>

Hi @martin9,

This this Knowledge Article will help you with troubleshooting the issue:  
[https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time-error-in-rules/87150](https://community.auth0.com/t/request-to-webtask-exceeded-allowed-execution-time-error-in-rules/87150)

I would advise you to insert `trustServerCertificate: true` inside of the options for the connection.

If you have any other questions feel free to ask.

Have a good one,  
Vlad

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 12, 2025, 6:04pm UTC](https://community.auth0.com/t/how-do-i-login-to-my-local-sql-server-database/90739/4 "2025-03-12T18:04:47Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Tiffani](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tiffani/32/75235_2.png) [@Tiffani](https://community.auth0.com/u/Tiffani)\
**Post date:** [July 29, 2026, 4:48pm UTC](https://community.auth0.com/t/how-do-i-login-to-my-local-sql-server-database/90739/5 "2026-07-29T16:48:53Z")

</div>


