How to Execute Queries in Command Prompt

How to Execute Queries in Command Prompt

Step 1- First Store the Backup of Customer's Database.

Step 2 - Attach the Customer Database (Session & VIDYACOMM) with SQL Server (Not LocalDB).

Step 3- Paste the query file in C Drive.

Step 4- Open Command Prompt.

Step 5- Type Script sqlcmd -S .\<SQL Instance Name> -i C:\<SQL File Name>.sql

    Ex-  sqlcmd -S .\SQLEXPRESS1 -i C:\Insert_Sess.sql

Step 6- After pressing enter the query will be executed.

 


 

 Step 7- Delete the SQL file from C drive after executing the query.

Note: - You need to update the SQL Server instance name. And also update the SQL file name (Which you pasted in C drive).

 

 

 


    • Related Articles

    • Certificate or Student Modify Section Not Working

      Issue: Certificate or Student Modify Section Not Working Problem: Sometimes, after updating the software, the Certificate Modify or Student Modify section may not work properly. You may also notice that generated certificates are not showing. Reason: ...
    • ⚙ Bypass Powershell 2.0 in Windows 11

      ⚙ Bypass PowerShell 2.0 in Windows 11 How to Run loadGAC.ps1 in PowerShell (PowerShell 2.0 DLC Setup) ? Overview This article explains how to properly execute the loadGAC.ps1 script after downloading and extracting the ps2DLC.zip file. ❗ Common ...
    • Error: 50- Local Database Runtime error occurred. Error occurred during LocalDB instance startup: SQL Server Process failed to start.

      Problem: - SQL Server Installation failed and also attach database into Local DB then error showing :- (Error: 50- Local Database Runtime error occurred. Error occurred during LocalDB instance startup: SQL Server Process failed to start.) Reason 1:- ...
    • Bulk Printing of Marksheet Not Possible

      ? Issue Description Users are unable to perform bulk printing of marksheets. When clicking on “Print All”, the system generates a PDF instead of printing directly. ⚠️ Root Cause The default printer is set to Microsoft Print to PDF, causing all print ...