February 22, 2012 at 12:08 pm
Noob to using SQLCMD and getting this when running script from Powershell. Any help would be greatly appreciated!!!!
PS C:\> SQLCMD -S CONTOSOWXP01\SQLEXPRESS CREATE LOGIN [NewUser] WITH PASSWORD = 'password', DEFAULT_DATABASE=[Mydatabase], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
Sqlcmd: 'CREATE LOGIN [NewUser] WITH PASSWORD = password DEFAULT_DATABASE=[Mydatabase] CHECK_EXPIRATION=OFF CHECK_POLIC
=OFF': Unexpected argument. Enter '-?' for help.
PS C:\> -?
Missing expression after unary operator '-'.
At line:1 char:2
+ - <<<< ?
PS C:\>
March 5, 2012 at 2:22 am
Try this:
SQLCMD -S CONTOSOWXP01\SQLEXPRESS -Q "CREATE LOGIN [NewUser] WITH PASSWORD = 'password', DEFAULT_DATABASE=[Mydatabase], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF"
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy