sqlcmd - Variations between Windows Server 2003 and Windows Server 2008

Posted on 2010-01-05
Last Modified: 2012-05-08
Is there a difference between Windows 2003 and Windows 2008 with respect to SQL 2008's sqlcmd utility?

In Windows 2003 if I install SQL 2008 Express w/Adv Services and run the command:

sqlcmd /A -Q "select * from sys.syslogins;"

the command succeeds and performs the query.

However under Windows Server 2008, if I install SQL 2008 Express w/Adv Services and run the same command:

sqlcmd /A -Q "select * from sys.syslogins;"

it fails to connect.

Is there a difference with respect to which operating system it is running on?  Is there a difference between types as well (i.e. x64 vs x86)?

Trying to script a process and based on my results looks like I will need to check the OS distribution, but does not make since because both OS's are running SQL 2008 Express.

Any help would be greatly appreciated.
Question by:yami_rider
    LVL 29

    Expert Comment


    Does your Windows 2008 server have multiple IP addresses assigned to it or multiple NIC's that are connected to the network?

    Windows 2008/Vista can have issues in these cases with all SQL versions.

    Troubleshooting: Timeout Expired - Unusual Errors - Multiple Server IP Addresses
    LVL 5

    Expert Comment

    Try specifying the instance name "-S server_name" in you command. Your 2008 instance may not be the default instance.

    Accepted Solution

    I figured it out.  The issue was SQL 2008 Standard and SQL 2008 Express have a different approach to DAC.  Therefore my command was failing.

    With DAC I need to add the trace 7806 to the start up parameters.  In doing so I can execute

    sqlcmd -E -S.\SQLEXPRESS -A without any issues.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now