Groups | Blog | Home
all groups > sql server programming > june 2006 >

sql server programming : Connection from command prompt


MUKUT
6/5/2006 11:54:24 PM
All,
Though sound silly, but I require it by any chance...
I need to connect to the sql server 2000 from command prompt and then I
need to run query and see the resultset.
Any suggestion...??
Mike Hodgson
6/6/2006 12:00:00 AM
osql.exe in SQL 2000 (in SQL 2005 this command line utility is replace
by sqlcmd.exe). You can use the -q or -Q switches to specify a batch to
run rather than use it in interactive mode. Or even use the -i switch
to specify an input file that contains the SQL batch you wish to run.

--
*mike hodgson*
http://sqlnerd.blogspot.com



[quoted text, click to view]
Vadivel
6/6/2006 12:12:01 AM
Mukut, Just do this,
1. Start >> Run >> cmd
2. osql /?

THis would list out the possible options for this osql utility.

I am sure this is what you are looking for :)

Best Regards
Vadivel

http://vadivel.blogspot.com

[quoted text, click to view]
MUKUT
6/6/2006 11:06:18 PM

Thanks all for your kind suggestion.
AddThis Social Bookmark Button