sqlcmd - Variations between Windows Server 2003 and Windows Server 2008

Posted on 2010-01-05
Medium Priority
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

ID: 26187222

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

Expert Comment

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

Accepted Solution

yami_rider earned 0 total points
ID: 26206496
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.


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

831 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