Quantcast
Viewing latest article 32
Browse Latest Browse All 50

SQL Server: I need to get to a remote server and management studio is broken. How can I login without ssms?

Try using osql .  It can be a life saver.  Here's an example of the most common usage:

osql -E -S myMSSQLServerName        /* This uses windows authentication to connect to a server */

osql -?                                                  /* lists all the switches available to use with osql */

Once you see the SQL prompt (1> ) , you can interact with the server.

1> USE myDatabaseName
2> GO
3> SELECT col1, col2
4> FROM myTable
5> GO
6>
7> EXIT   

Here's a link or two to get you started.
http://msdn.microsoft.com/en-us/library/aa214012(v=sql.80).aspx    /* options available */

http://msdn.microsoft.com/en-us/library/aa213088(v=sql.80).aspx    /* accessing data through osql */



Viewing latest article 32
Browse Latest Browse All 50

Trending Articles