Execute SQL script with a list of scripts/files inside

I am not sure how to execute an SQL script file which contains a list of SQL files. 

For example I have a file 'main_script.sql' like this:

 

source a.sql

source b.sql

source c.sql

 

I would like to execute the 'main_script.sql' in a batch mode, but I did not find how to do it within DataGrip. 

Any ideas?

 

2

Hi,

As a workaround, you can try to attach directory with your source files, then select script files you want to be executed and then to fire action `Run '<N> files'...`

1
Avatar
Permanently deleted user

Yes, the might work... sometimes. Thank you very much.

At the same time, if the sequence of scripts for execution is important, the workaround can cause errors in some situations.

 

 

0

Yes, you're right. But in case you want to run scripts one by one you can do it manually since DG doesn't have functionality you ask.

0

请先登录再写评论。