Batch File to Execute Multiple SQL Scripts in one go | By SQL Training | By SQL

preview_player
Показать описание
This session will help you understand the following:
1.) What is batch file.
2.) How to create batch file
3.) How to create batch file to execute multiple sql scripts in a folder
4.) Batch file commands

Thanks for Watching !
By SQL Training
By SQL
Комментарии
Автор

Thanks for this video.. Never execute. Bat file in administrator mode.. Execute it with double click only.

KanhaiyaKumar-iszv
Автор

this was a nice and short explanation. Using it I was able to create the batch file easily. However, it should be pointed out, that if you put say 3 SQL select queries in the target folder on your machine and run the script, it will run fine but simply create a sql output file that outputs the result sets of the 3 select queries. Not what you would want. Clearly, what using this batch file is intended for is action queries like update, delete, append etc.

Robleh
Автор

Great job. Thanks for uploading useful information.

swapnilwankhede
Автор

Explained with very simple example. Awesome.

sudhirpatra
Автор

Where did u declare the sql file path in that batch script? And without any middleware how u are running that bat side?

jackrock
Автор

Hi mam i m facing sqlcmd is not internal and external, i have sql developer not able set env path, not getting microsoft sql developer in program file
How i can resovle this error

ashwinikale
Автор

i have this error

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server [2]. .
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
Press any key to continue . . .

whet the sulotions ?

abdullahkashgri
Автор

Hi what is the script if i use a folder in my desktop and use server authentication?

ad
Автор

Hello I am facing issue like Named piped Providers : could not open the connection. also i have "\" in my servername.

amarkamble
Автор

Thank you..Can we run a batch file inside a stored procedure?

smithazacaria
Автор

I got thi error: "Unknown option -d". Please help!

vladcalin
Автор

Can you explain how to execute batch file for pgsql select querie?

sukhadapednekar
Автор

can anyone please let me know how can i run multiple sql files in a order with generating log for each sql file

chaitanyamelam
Автор

Good... one question why can't we create all SQL statements in single file ?

venkichinni
Автор

Hi Ma'am pls let me know how to execute multiple readymade SQL's scripts at one time..there r 50 SQL's scripts i need to run every month, so pls advise how to run those SQL's at same time..also i need to amend only issue date range in all those SQL's before excute in every month..pls advise

honeyrr
Автор

Hi I have done but it showing error using sql server authebtication

manjulathangavel
Автор

Can you please the comment the command also

NARESHYadav-mdvy
Автор

hey after the "presss anything to continue" nothing happens

zikoraswrld
Автор

@echo off
@echo Excuting
for %%C in (*.sql) do sqlcmd -S servername -d databasename -E -i "%%C"
Pause

nhanthienthien