Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
linoyel
Specialist
Specialist

Run SQL Server job from Qlikview script

Hi, does anyone knows if it's possible to run SQL Server job directly from Qlikview script?

If it's possible, how to do it?

Thanks in advance

1 Solution

Accepted Solutions
Gysbert_Wassenaar

1. You can create stored procedures to run jobs: Simple way to create a SQL Server Job Using T-SQL

2. You can execute stored procedures that update, delete etc in the SQL Server database. But only if you have the credentials that allow that. If you only have read-only access then obviously you can only read.


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Gysbert_Wassenaar

You can execute SQL Server stored procedures from the qlikview script using the SQL EXECUTE keywords. See this discussion for example: Re: Ho to execute a Store Procedure in Qlikview

Ask your local friendly SQL Server database administrator for help if necessary, for example for the correct credentials needed to run the stored procedure.


talk is cheap, supply exceeds demand
linoyel
Specialist
Specialist
Author

Thanks Gysbert.

Yeah, I know how to run stored procedures from Qlikview.

The question is:

1. if it's possible to run SQL Job consisting of several steps from Qlikview as well

2. if it's possible to run stored procedure that not only selects but also updates/deletes something from SQL database, when qlikview connection is to "mirror" database which is read-only. Probably not... 😕

Gysbert_Wassenaar

1. You can create stored procedures to run jobs: Simple way to create a SQL Server Job Using T-SQL

2. You can execute stored procedures that update, delete etc in the SQL Server database. But only if you have the credentials that allow that. If you only have read-only access then obviously you can only read.


talk is cheap, supply exceeds demand
linoyel
Specialist
Specialist
Author

Yeah, that's right, I didn't think about creating a stored procedure that runs job.

Great, thank you!

linoyel
Specialist
Specialist
Author

I looked at the link you've provided - "Simple way to create a SQL Server Job Using T-SQL".

As I understand, what's described there is the way to create a scheduled job using T-SQL instead of creating it via SSMS GUI. So it just creates the job that will still run on it's SQL Server schedule.

What I meant was to create an SQL Server job (doesn't matter how - via GUI or this stored procedure described in the link) but NOT schedule it there because I want to run it from Qlikview reload script directly. Is that possible?

Gysbert_Wassenaar

I'm no SQL Server expert, but I seem to remember that just about anything related to managing a SQL Server instance is done with stored procedures. The UI simply executes the stored procedures in the background. But they can be executed directly too. See for example sp_start_job (Transact-SQL)


talk is cheap, supply exceeds demand
linoyel
Specialist
Specialist
Author

OK.

Thanks again