- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 01:52 PM
I am trying to create a SQL task in Workflows. I have my query which executes successfully in the SQL editor, and it is saved in a repo.
However, when I try to execute the task, the below error shows.
Query text can not be empty: BAD_REQUEST: Query text can not be empty.
Hovering over the magnify option shows the query blank too.
Some queries I didn't create do appear though, so I'm not sure what I'm missing.
- Labels:
-
Workflows
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 01:16 PM
It ended up being that the query wasn't actually saved. Once I manually clicked save, the query preview showed and the task ran successfully.
I'm really surprised that was the reason. I had moved the query around to different folders and closed and reopened it in the editor a few times after having logged out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 09:32 PM
Does it run outside of repo if you try to create a job from simple notebook?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 11:11 AM
Yes, I can run the task when the type selected is Notebook and the code is moved to a sql notebook. The issue only occurs when trying to run a task of type SQL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 12:35 PM
Hey @ggsmith
I tried running it, and it worked without any issues on my end.
Just to double-check, can you see your query inside SQL > Query > My Queries? If it appears there, try clicking on it to view the query. It’s possible that you might have accidentally deleted the query from the SQL editor and saved it, which could explain why it’s empty.
🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 12:42 PM
Yea it's there in my queries. And after selecting the open icon next to the query, it opens in the editor. I thought it could be a bug with queries created in the New Editor, but I tested that too and still a blank query. It's odd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 12:49 PM
I can able to reproduce the Issue. Can you please check the sql warehouse has permissions to run the query? below I have tested with a sql warehouse doesn't have permissions to run the query and sql warehouse has permissions to run the query.
Job Task Details:
Failed Run and Successful Run:
Failed Run:
Successful Run:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 02:02 PM
That would make sense. Can you tell me what the permissions look like between the two in your example? I'm not very familiar with permissions for the warehouses and want to be able to explain it correctly to my admin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 02:36 PM
Hey @ggsmith ,
Go to where the query is stored, access the Permissions settings, and ensure the user who runs the job (as defined in Run As inside the job details) has the necessary permissions. By default, the Run As user is set to the owner or the creator of the query.
More info about QUERY Permissions:
🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 01:16 PM
It ended up being that the query wasn't actually saved. Once I manually clicked save, the query preview showed and the task ran successfully.
I'm really surprised that was the reason. I had moved the query around to different folders and closed and reopened it in the editor a few times after having logged out.

