December 4, 2006 at 7:31 am
how can one connect to sql server db via dos.
how is it done tell more about it.
December 4, 2006 at 8:59 am
Depends what your trying to do.
You can use osql
from BOL
The osql utility allows you to enter Transact-SQL statements, system procedures, and script files. This utility uses ODBC to communicate with the server.
osql
[-?] |
[-L] |
[
{
{-U login_id [-P password]}
| –E
}
[-S server_name[\instance_name]] [-H wksta_name] [-d db_name]
[-l time_out] [-t time_out] [-h headers]
[-s col_separator] [-w column_width] [-a packet_size]
[-e] [-I] [-D data_source_name]
[-c cmd_end] [-q "query"] [-Q "query"]
[-n] [-m error_level] [-r {0 | 1}]
[-i input_file] [-o output_file] [-p]
[-b] [-u] [-R] [-O]
]
December 4, 2006 at 10:45 pm
If you need to transfer data between SQL server and a flat-file, you could also try the BCP command.
BCP {[[database_name.][owner].]{table_name | view_name} | "query"}{in | out | queryout | format} data_file
[-m max_errors] [-f format_file] [-e err_file]
[-F first_row] [-L last_row] [-b batch_size]
[-n] [-c] [-w] [-N] [-V (60 | 65 | 70)] [-6]
[-q] [-C code_page] [-t field_term] [-r row_term]
[-i input_file] [-o output_file] [-a packet_size]
[-S server_name[\instance_name]] [-U login_id] [-P password]
[-T] [-v] [-R] [-k] [-E] [-h "hint [,...n]"]
December 5, 2006 at 8:59 am
C:\Documents and Settings\jambuk>isql -E
1> use JambuDB
2> select * from t1
3> go
f1 f2 f3 f1Avg
----------- ----------- ----------- -----------
111 222 333 444
(1 row affected)
1> exit
C:\Documents and Settings\jambuk>
December 6, 2006 at 3:21 am
For sql server 7.0, use "isql"
Sql server 2000, "osql"
And sql 2005, "sqlcmd"
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply