This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Error while calling sqlcmd (sql server 2008 R2) from Java 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Error while calling sqlcmd (sql server 2008 R2) from Java 7" Watch "Error while calling sqlcmd (sql server 2008 R2) from Java 7" New topic
Author

Error while calling sqlcmd (sql server 2008 R2) from Java 7

John Greek
Greenhorn

Joined: Jan 24, 2012
Posts: 1
Hi,

I am facing some error wile executing sqlcmd form java. take a look...

Process process = Runtime.getRuntime().exec("sqlcmd -m-1 -S localhost,1433 -d my_server -U sa -P abc -Q \"select * from Assests where AssetID > 'G123204E4-1234-4A31-B37B-0092D68DA429'\" -k2 -W -h-1 -s\",\" -o \"D://Assests.csv\"");

while running sqlcmd from sqlclient its working fine but form java it giving expression error

Msg 4145, Level 15, State 1, Server SANDIPB-PC, Line 1
An expression of non-boolean type specified in a context where a condition is expected, near 'AssetID'.

and when I change ">" to "=" its working fine.

can any one know why this is happening. Please let me know
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while calling sqlcmd (sql server 2008 R2) from Java 7
 
Similar Threads
Webspere 345 exam questions
Calling command prompt from java
Where to find ans for mock test by Valentinn Cretazz
J2EE Recommended Reading
Passed 700,701 and 340 last Thursday