![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | sqlcmd and powershell and a failed login I am confused. I have a command line that executes as expected in a CMD shell but doesn't in a PowerSehll box. Specifically, the following fails: & sqlcmd -E -S (local)\SQLExpress -d adatabase -i ascript.sql while this suceeds in a DOS box sqlcmd -E -S (local)\SQLExpress -d adatabase -i ascript.sql The error is Cannot open database "adatabase" requested by the login. The login failed. Msg 18456, Level 14, State 1, Server localname\SQLExpress, login failed for user 'domain\me' Now, if I just & sqlcmd -S (local)\SQLExpress I get to an interactive rpompt and I can then "use" and execute DDL statements. So I must be missing some part of the security setting for PowerShell that are different from the DOS box, and I am wondering if y'all could help me figure out what. TIA I know, the -E is redundant. I cd to the folder where th script lives. The database exists. TCP for the database is enable, as is named pipes. The current login is a user in the database mapping to the dbo schema. -- I'm not sayin' anything, I'm just sayin' |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: sqlcmd and powershell and a failed login
Might this have to do with whether you're running PowerShell with Administrator priviledges? Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||
| Guest | Re: sqlcmd and powershell and a failed login -- I''m not sayin'' anything, I''m just sayin'' "Marco Shaw [MVP]" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||
| Guest | Re: sqlcmd and powershell and a failed login
PSH> sqlcmd -E -S "(local)\sqlexpress" -d database_name Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #5 (permalink) | ||||||||||||
| Guest | Re: sqlcmd and powershell and a failed login >
Does that have any significance? | ||||||||||||
My System Specs![]() | |||||||||||||
| | #6 (permalink) | ||||||||||||||||||||||||
| Guest | Re: sqlcmd and powershell and a failed login SkipSailors wrote:
using v1... The above worked for me. My database name was a simple string (no spaces or special characters). Marco | ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #7 (permalink) | ||||||||||||
| Guest | Re: sqlcmd and powershell and a failed login
joy. My database name is also simple, only ASCII-type characters in the name with no spaces or tabs or anything | ||||||||||||
My System Specs![]() | |||||||||||||
| | #8 (permalink) | ||||||||||||||||||||||||
| Guest | Re: sqlcmd and powershell and a failed login SkipSailors wrote:
point... Marco | ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Login Completely Blocked w/User Profile Service Failed the Login | THNKIT | Vista account administration | 10 | 07-15-2008 06:42 PM |
| Login registration has failed the profile cannot be loaded | Steve | Vista General | 1 | 04-08-2008 01:09 PM |
| Login failed | Bexy | Vista mail | 3 | 03-08-2008 03:03 PM |
| Always failed login at Startup | vbclown | Vista account administration | 1 | 11-10-2007 04:23 PM |
| User Login Failed | Mr_Lambie | Vista account administration | 2 | 07-27-2007 05:18 PM |