Link to home
Start Free TrialLog in
Avatar of bibi92
bibi92Flag for France

asked on

Mask password in sqlcmd command

How it is possible to avoid putting in light the password of one to use sql in a sqlcmd script?

Thanks

bibi
ASKER CERTIFIED SOLUTION
Avatar of Lara F
Lara F
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bibi92

ASKER

Thanks, I have tested this :

SET SQLCMDUSER=B00A
SET SQLCMDPASSWORD=toto
SET SQLCMDSERVER=SRVSERVER\TEST
SET SQLCMDDBNAME=dbname
sqlcmd  -Q "select count(*) from ATEST" -o d:\test.sql

But, I have this error:
Login failed for user 'B00A'.

Thanks
bibi
Avatar of bibi92

ASKER

thanks bibi