Run SQL script (Ctrl+Shift+F10) - Target Data Source / Schema selection disappears after a while
Hi,
I use the Run Sql Script option to run sql statements saved in sql files. When I run them I get presented with the Edit Configuration dialog and I usually select the target server and database. I use SQL server 2017.
What I noticed is that this selection disappears after while and I have to make the selection again. I could not figure out a pattern though, but it looks like after a week or so the selection is gone. I have to say, it is annoying.
My question to the IJ support, is: what triggers the reset of the target data source / schema selection?
Thanks
Please sign in to leave a comment.
What is your current DataGrip version?
To investigate this issue, please upload the idea log from Help - Show Log in Files onto our FTP https://uploads.jetbrains.com/ and provide the upload id in your reply
DataGrip 2025.2.2
Build #DB-252.25557.34, built on August 14, 2025
Source revision: 4117552b950b5
Runtime version: 21.0.8+1-b1038.68 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Sorry, I cannot send you any log files due to NDA. I guess I will have to live with this issue - it is ok.
If you find errors below Last Action string related to Run Configurations, then this could be a hint.
I encountered the same problem; every time I using Ctrl+Enter to run code , the selected schema reverts to the default, and I have to manually select it each time. When I need to run the code, I'm using a Spark URL conncet now, and setting the default database or schema doesn't work, it's very frustrating.
Huanhuan Zhoukang
To investigate this issue, please upload the idea log from Help - Show Log in Files onto our FTP https://uploads.jetbrains.com/ and provide the upload id in your reply
Aleksandr Molchanov - imo, you are asking us to send you the logs - but the behaviour exhibited is that the targeted server(s)/database(s) attached to a sql script disappear. I don't know when that happens. I can run a sql script today, and then next day, I want to run it again only to discover the selection is not there anymore. Imo, the developer that coded the attachment of the server/database to a sql script or group of sql scripts should review how this association is saved, i.e. the association between the sql file or sql files and the list of target servers/databases, and then check how this association can be disappear.
I experienced this yesterday again. I don't know what the pattern is. Could changing git branches have an effect on it? But I didn't change the code branch.
Why don't you try it? It should take 30s of your time. Run a sql script today, select a server/database, come back to it tomorrow or maybe in 2 days and see if it is still there.
Just to be sure, this is what I am talking about:
The selection might disappear after I re-open the dialog later. I could not figure out a pattern.
The exclamation mark warns me the script has 3 database switches, i.e. 3 use statements. They all select the same database I selected in the list.
I'll customize the job according to your current scenario and will observe this behavior. However, please note that we use our product on a regular basis, having various settings set up, including this one, and we have still not replicated this behavior. We are therefore assuming this issue could be related to an individual configuration setup + environment. Having logs for the time range when you noticed this issue would help in investigating the cause. Once again, we're not pushing anyone, and sending logs would be the last resort whenever it comes to investigating issues. However, this issue has been reported only twice for the whole period, so we'd really appreciate if you could provide us with some.