Hi everyOne...
I am new to sql Server and installed Ms sql 2005. i want to use command prompt for queries But whenever i use the sqlcmd command my computer gets restarted...

Why it is so????
can anyOne plz Help...

Dani AI

Generated

This symptom (invoking sqlcmd causes the PC to restart) strongly suggests a Windows-level crash (automatic reboot on system failure) rather than a normal client error. The two replies already on the thread ( and ) offer useful alternative CLIs to continue work, but the priority should be to collect evidence and isolate whether the problem is local, a corrupted client binary, a driver/hardware fault, or interference from security software.

Recommended diagnostic sequence (in order):

  • Capture the failure: turn off automatic restart on system failure so any blue‑screen text stays visible (System -> Advanced system settings -> Startup and Recovery -> Settings -> uncheck Automatically restart). Record the exact time of the crash.
  • Check Event Viewer (eventvwr.msc): inspect System and Application logs around the crash time for entries such as Kernel‑Power/Event ID 41, BugCheck, driver failures, or SQL client errors. Note timestamps and event IDs.
  • Look for crash dumps in C:\Windows\Minidump and %SystemRoot%\MEMORY.DMP. Use Windows Debugging Tools (WinDbg) to get the bugcheck code and offending module if present.
  • Isolate the client vs machine: invoke the same action from another client machine or from SSMS/another CLI. If the remote client works, the issue is local to the machine running sqlcmd.

Mitigation and follow-up steps:

  • Repair or reinstall the SQL Server client tools / native client (use the SQL Server setup to repair client components).
  • Temporarily use an alternative CLI or GUI (as suggested by and ) while diagnosing.
  • Run basic system checks: sfc /scannow, Windows Memory Diagnostic or memtest, and a full malware/AV scan. Investigate recent driver updates or third‑party software that hooks console/IO.
  • If dumps point to a driver or kernel module, update or remove that driver. If the cause remains unclear, analyze the minidump with WinDbg or consult Microsoft documentation for the sqlcmd utility for compatibility notes (sqlcmd utility documentation).

Cautions: analyzing system crash dumps and changing drivers can affect system stability. Collect logs and dumps before making major changes.

Recommended Answers

All 2 Replies

There is a free tool "SQLS*Plus" which is an SQL*Plus for SQL Server. Works with SQL Server 2000/2005 and 2008

Very flexible with data formatting (set lines size, pagesize, etc), variables (&, &&), spool, etc - light years better than isql, osql or sqlcmd

I found it at http://www.memfix.com

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.