Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2006-02-08 : 06:02:48
|
| I use osql to find out the number of record:osql -E -d ORDER -S DATASERVER -Q "select COUNT(*) from Order_Activity" >> c:\log.txtIt works fine. Now, DATASERVER need login name and password, how to modify command above? |
|
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2006-02-08 : 06:12:12
|
| Hi,Use -U and -P option for specifying User Id and Passwordosql -E -d ORDER -U LoginId -P password -S DATASERVER -Q "select COUNT(*) from Order_Activity" >> c:\log.txt |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-02-08 : 06:22:31
|
| And drop the "-E" (which is used for a Trusted Connection)Just type OSQL for a list of command line switchesKristen |
 |
|
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2006-02-08 : 06:24:42
|
| Thank you.First run, got error: Conflicting switches : -U and -EAfter delete -E, it works fine. |
 |
|
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2006-02-08 : 06:46:49
|
| missed that in copy paste.. :( |
 |
|
|
|
|
|