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 */


posted on Wednesday, March 20, 2013 8:06 PM
Filed Under [ Practical Answers SQL ]

Comments

No comments posted yet.

Post A Comment
Title:
Name:
Email:
Comment:
Verification: