Article ID: 18529
Product: Good Messaging Server SQL
Date: 26 August 2009

Title:
Manually Installing Microsoft SQL Server 2005 Command Line Query Utility (SQLCMD)

You can directly download the MSI packages containing SQLCMD from Microsoft. The SQLCMD.EXE tool is contained within the "Microsoft SQL Server 2005 Command Line Query Utility package", however the "Microsoft SQL Server Native Client" package is a prerequisite before installing. These are the same binaries redistributed with the GMC however in some circumstances it may be useful to test connectivity manually with downloads direct from Microsoft and not use the copy that Good redistributes.

  1. First go to the Microsoft page "Feature Pack for Microsoft SQL Server 2005 - February 2007"
    http://www.microsoft.com/downloads/details.aspx?FamilyId=50b97994-8453-4998-8226-fa42ec403d17&DisplayLang=en
  2. Find "Microsoft SQL Server Native Client" on the page and download the appropriate package. Should be "X86 Package" since we don't claim to support 64 bit OS. But if they are 64 bit they could grab the "X64 Package"
  3. Install the msi package just downloaded, should be 'sqlncli.msi' if they grabbed the X86 package.
  4. Find "Microsoft SQL Server 2005 Command Line Query Utility" on the page and download the appropriate package. Should be "X86 Package" since we don't claim to support 64 bit OS. But if they are 64 bit they could grab the "X64 Package"
  5. Install the msi package just downloaded, should be 'SQLServer2005_SQLCMD.msi' if they grabbed the X86 package.
  6. Open a new command window. [Start] -> "Run..." -> Open: cmd.exe
  7. In the command window run the command: SQLCMD.exe /?
    They should see help text that looks similar to this:

    C:\Documents and Settings\mjang>sqlcmd.exe /?
    Microsoft (R) SQL Server Command Line Tool
    Version 9.00.4035.00 NT INTEL X86
    Copyright (c) Microsoft Corporation. All rights reserved.

    usage: Sqlcmd \[-U login id\] \[-P password\]
    \[-S server\] \[-H hostname\] \[-E trusted connection\]
    \[-d use database name\] \[-l login timeout\] \[-t query timeout\]
    \[-h headers\] \[-s colseparator\] \[-w screen width\]
    \[-a packetsize\] \[-e echo input\] \[-I Enable Quoted Identifiers\]
    \[-c cmdend\] \[-L\[c\] list servers\[clean output\]\]
    \[-q "cmdline query"\] \[-Q "cmdline query" and exit\]
    \[-m errorlevel\] \[-V severitylevel\] \[-W remove trailing spaces\]
    \[-u unicode output\] \[-r\[0\|1\] msgs to stderr\]
    \[-i inputfile\] \[-o outputfile\] \[-z new password\]
    \[-f <codepage> \| i:<codepage>\[,o:<codepage>\]\] \[-Z new password and exit\]
    \[-k\[1\|2\] remove\[replace\] control characters\]
    \[-y variable length type display width\]
    \[-Y fixed length type display width\]
    \[-p\[1\] print statistics\[colon format\]\]
    \[-R use client regional setting\]
    \[-b On error batch abort\]
    \[-v var = "value"...\] \[-A dedicated admin connection\]
    \[-X\[1\] disable commands, startup script, enviroment variables \[and exit\]\]
    \[-x disable variable substitution\]
    \[-? show syntax summary\]


This is how you get SQLCMD installed manually by itself without using our installer.