# Connect using database user credentials

This method needs a database user with db\_datareader role (for sampling data) and view definition privilege (for access policy).

**Steps:**

1. Create SQL login in master database.\
   **Query**

   CREATE LOGIN \[testLogin] WITH PASSWORD = '\<strong\_password\_goes\_here>';<br>
2. Switch to the database and Add Database user for above login.\
   **Query**\
   CREATE USER \[testUser] FROM LOGIN \[testLogin];<br>
3. Add user to default database role (db\_datareader) and grant view definition privilege.\
   **Query**

   ALTER ROLE db\_datareader ADD MEMBER \[testUser];

   GRANT VIEW DEFINITION TO \[testUser];

**Required Parameters:**

* Server name (example: testdb.database.windows.net)
* Database name
* Login name
* Password


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.protecto.ai/getting-started/protecto-overview/introduction/add-new-data-source/azure-sql/connect-using-database-user-credentials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
