on 05-25-2011 3:21 PM
dear friends,
i m not able to connect MS SQL SERVER from command prompt..
do you know how to connect from command prompt or any other ways to connect to database only for delete SAP* user purpose.
thanks
zaheer
Hi,
you can use the SQLCMD tool:
Microsoft (R) SQL Server Command Line Tool
Version 10.50.1600.1 NT x64
Copyright (c) Microsoft Corporation. All rights reserved.
usage: Sqlcmd [-U login id] [-P password]
[-S server] [-H hostname] [-E trusted connection]
[-N Encrypt Connection][-C Trust Server Certificate]
[-d use database name] [-l login timeout] [-t query timeout]
[-h headers] [-s colseparator] [-w screen width]
[-a packetsize] [-e echo input] [-I Enable Quoted Identifiers]
[-c cmdend] [-L[c] list servers[clean output]]
[-q "cmdline query"] [-Q "cmdline query" and exit]
[-m errorlevel] [-V severitylevel] [-W remove trailing spaces]
[-u unicode output] [-r[0|1] msgs to stderr]
[-i inputfile] [-o outputfile] [-z new password]
[-f <codepage> | i:<codepage>[,o:<codepage>]] [-Z new password and exit]
[-k[1|2] remove[replace] control characters]
[-y variable length type display width]
[-Y fixed length type display width]
[-p[1] print statistics[colon format]]
[-R use client regional setting]
[-b On error batch abort]
[-v var = "value"...] [-A dedicated admin connection]
[-X[1] disable commands, startup script, enviroment variables [and exit]]
[-x disable variable substitution]
[-? show syntax summary]
You have to have the SQL Server tools installed on the box, to get sqlcmd.
You then can connect with SQL authentication
sqlcmd -S <Servername\Instancename> -U user -P password
or with windows authentication
sqlcmd -S <Servername\Instancename> -E
Best regards
Clas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can always start SQL Server Management Studio and go into Query Analyzer (click on New Query button). Type in your queries as described above. There also is a command parse function to check your syntax before execution.
Regards,
Alan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How are you trying to connect to SQL server (what commands are you using?
Here's are some references to start with:
http://www.cyberciti.biz/faq/howto-ms-sql-list-tables-and-database/
Thanks!
J. Haynes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.