0

I am attempting to use a script task (C#) within SSIS (SQL Server 2008 BIDS) and am having trouble sending the actual SQL string to SQL plus. I can get it to take my username and password, but cannot seem to get it to take a SQL string from the C# script. I cannot have the SQL be in a .sql file, and need to be able to send the SQL as a string from within the C# script - any ideas?

Here is my code (sql string commented out):

public void Main()

    {
        ProcessStartInfo processInfo = new ProcessStartInfo();
        //string SQLstring = UPDATE table SET field1 = 'xxx' WHERE id2 = 'yyyy'
        processInfo.FileName = "sqlplus.exe";
        processInfo.Arguments = "user/pass@database";
        Process process = Process.Start(processInfo);
    }

How can I include the SQL string and send it to SQL plus to execute? Also, will SSIS known when the script is done running and not move to the next task until complete?

Thank you all for your assistance

4

0 回答 0