Come posso connettermi a SQL Server dal prompt dei comandi usando l'autenticazione di Windows?
Questo comando
Sqlcmd -u username -p password
presuppone un nome utente e una password per SQL Server già impostati
In alternativa, come posso configurare un account utente dal prompt dei comandi?
Ho SQL Server 2008 Express su un computer Windows Server 2008, se questo si riferisce.
È possibile utilizzare una sintassi diversa per ottenere cose diverse. Se è l'autenticazione di Windows che desideri, puoi provare questo:
sqlcmd /S /d -E
Se si desidera utilizzare l'autenticazione di SQL Server, è possibile provare questo:
sqlcmd /S /d -U -P
Definizioni:
/S = the servername/instance name. Example: Pete's Laptop/SQLSERV
/d = the database name. Example: Botlek1
-E = Windows authentication.
-U = SQL Server authentication/user. Example: Pete
-P = password that belongs to the user. Example: 1234
Spero che questo ti aiuti!
Prova questo :
- Istanza predefinita
SQLCMD -S SERVERNAME -E <br/>
--O
-- Istanza con nome
SQLCMD -S SERVERNAME\INSTANCENAME -E <br/>
--O
SQLCMD -S SERVERNAME\INSTANCENAME,1919 -E
Maggiori dettagli possono essere trovati qui
Questo potrebbe aiutare .. !!!
SQLCMD -S SERVERNAME -E
Dopo alcuni tentativi, questi sono gli esempi che sto usando per connettersi:
Specificare il nome utente e la password:
sqlcmd -S 211.11.111.111 -U NotSA -P NotTheSaPassword
Specifica anche il DB:
sqlcmd -S 211.11.111.111 -d SomeSpecificDatabase -U NotSA -P NotTheSaPassword
digita sqlplus/"as sysdba" in cmd per la connessione nel prompt cmd