Before we begin the setup, let's review the requirements to complete our scenario:
- Execution needs to happen without a user session
- The account's minimum privileges include access to a local database
- The account's password should not expire
- Script results need to be available for review in the event of an error
So that we do not use password credentials in clear text (for the database connection), we will use a domain account to run the script. When creating the account, make sure you check the Password never expires setting:
In SQL Server, we give the account Select access only to the tables we are using. A better approach ...