Running an ssis package without program/installation dependencies

47 Views Asked by At

I have a simple SSIS package that updates a sql server table from a flat file that's generated by another program. This needs to be run adhoc by dozens of non technical employees. I've investigated various methods such as powershell scripts or batch files but they all appear to need some SSIS/SSMS/DLL installed. For example my batch file

osql -S "SERVER-NAME" -E -Q"exec msdb.dbo.sp_start_job 'DataRefresh'"

doesn't recognize the osql command on their machines. They do have access to the network drive where the sql server lives, and if they RDP into it they can run the batch file. But that's not ideal.

Is there a way to enable them to run the package without installing other programs? If not, what would be the method with the least overhead?

1

There are 1 best solutions below

0
babno On BEST ANSWER

No additional references, C# application in VS2022

using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace data_refresh
{
    internal class Program
    {
        static void Main()
        {

            SqlConnection conn = new SqlConnection("Data Source=<server name here>;Integrated Security=True");
            conn.Open();
            SqlCommand cmd = new SqlCommand("msdb.dbo.sp_start_job", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@job_name", "<job name here>");
            cmd.ExecuteNonQuery();


        }
    }
}