Use the facilities provided by the OS.
Preferably
If neither the -U option nor the -P option is specified, sqlcmd tries to connect by using Microsoft Windows Authentication mode.
Otherwise set up a user or group profile for running the script(s) that has the userid & password environment variables (SQLCMDUSER & SQLCMDPASSWORD) set in the profile. Profiles are encrypted.
That way, the scripts can only be run by those authorised to do so by the login id or group membership.
In reply to Re: Using Admin Passwords in Script
by BrowserUk
in thread Using Admin Passwords in Script
by OzVegan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |