Hi!
I need to execute an SSIS Package on SQL Server 2005 but programing them using the javasript code for a page web.
Anybody can help me please??
Thank you!
Hi!
I need to execute an SSIS Package on SQL Server 2005 but programing them using the javasript code for a page web.
Anybody can help me please??
Thank you!
JavaScript executing in a web page is executing in a client's browser. It can't directly call any code on the server.
You will need to create a web service, and have the page ask the service to execute the SSIS package. How to do that is beyond the scope of a single question. You'll want to learn how to use AJAX to call a web service, and how to execute an SSIS package from code (a web service, in this case).
More importantly, why do you have to do this with JavaScript? Why not do it in the codebehind, as part of a button click handler (as one example)?
JavaScript is a client-side language (and should stay that way!). You cannot run statements against a database from JavaScript. You need a server-side language for this (ASP.NET, PHP, or the like), or a web service for JavaScript to ping to kick it off.
Once you determine that, though, you can use sp_start_job
to kick off a SQL Server Agent job that in turn kicks off the SSIS package for you. Or, you can use an exec
command (depending on the language you use), and you can use the dtexec
utility to directly start the package.