29

I'm working on a Java program that is calling sqlcmd. It works perfectly on a computer with SQL server installed, but not at all on a computer that doesn't. I want to include the necessary exe and dll files to run this command in my jar. Anyone know which ones I need? I already included batchparser90.dll, sqlcmd.exe, and sqlcmd.dll. It still didn't work.

Any suggestions are appreciated. Thanks in advance!

3
  • 4
    Why aren't you just connecting to the server via JDBC? Commented Feb 18, 2010 at 18:00
  • 1
    Are you trying to run a sql command remotely from a machine without client tools installed using the client tools exe? Does that violate redistribution rules from the software owner? Commented Feb 18, 2010 at 18:02
  • @C. Ross - I don't want to connect to the database. I just want a list of available servers, and then, given a server, a list of available databases @William - I'm not quite sure what you mean by that. Commented Feb 18, 2010 at 18:04

3 Answers 3

72

Although it's probably too late for the original poster, for future reference, SQLCMD is freely downloadable, so it's not necessary to purchase SQL Server explicitly for this purpose. Presumably the user has SQL Server with CALs or they wouldn't need SQLCMD in the first place.

In any event, the 2008 R2 download as of my typing this is here:

http://www.microsoft.com/en-us/download/details.aspx?id=16978

Download the file: 1033\x64\SqlCmdLnUtils.msi

(EDIT 2013-05-01) Please note this is a fairly old release at this point - see the comments for updated links, or search the Microsoft Download Center for "Microsoft SQL Server Feature Pack" and pick the release that you prefer - the most recent or the one that matches your SQL Server version in use, as you see fit.

Sign up to request clarification or add additional context in comments.

7 Comments

A better link is microsoft.com/en-us/download/details.aspx?id=26728 and select the 1033\IA64\SqlCmdLnUtils.msi download. This should install the files to C:\Program Files\Microsoft SQL Server\100\Tools\Binn however it might not add them to the system path.
Correct. I meant to say the 1033\x64\SqlCmdLnUtils.msi link. Looks like there are anchor links for both the 2008 R2 SQLCMD ( microsoft.com/en-us/download/details.aspx?id=16978#SQLCMD ) and 2012 SQLCMD ( microsoft.com/downloads/… ) so those may be the best links to refer users to.
I also needed to add the SQL Server Native Client from here: microsoft.com/en-us/download/details.aspx?id=8824#SNAC
2012 SP1 feature pack is out and the SqlCmd MSI is reduced from 7MB to 2MB: microsoft.com/en-us/download/details.aspx?id=35580
The original question was "how can I ship sqlcmd with my app so the user doesn't have to have it installed beforehand?" Are there any plans to ship sqlcmd as an actual standalone tool? By standalone here I mean xcopy-deployable, not requiring an installer.
|
0

You can download SQLCMD and run as a standalone application. Follow the link.

Feature Pack for Microsoft SQL Server 2005 - Nov 2005

1 Comment

Similar, yes. Trolling, no (see from my history). The link is different as I needed SQL 2005.
-4

There is a free tool "SQLS*Plus" (on http://www.memfix.com ) which is like SQL*Plus for SQL Server.

Very flexible with data formatting (set lines size, pagesize, etc), variables (&, &&), spool, etc

Not sure about redistribution rights

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.