in reply to Re: Recoding a multi-sql-statement storedProc transaction in a script
in thread Recoding a multi-sql-statement storedProc transaction in a script
I spent a good while getting all my SQL ducks in order getting it so it worked properly. Now, I have to do this in the Perl script, so I have to now write these statements separately, run them one by one, grab values from them to run subsequent statements, check for errors, commit or rollback. I was hoping to just run the entire block of multiple statements as a single script. Hence, the pain.ALTER PROCEDURE sp @foo VARCHAR(250), @bar VARCHAR(250) AS BEGIN TRAN DECLARE @baz NUMERIC, @quux NUMERIC SELECT @baz = col FROM table1 WHERE condition SELECT @quux = col FROM table2 WHERE condition = @baz INSERT INTO table3 (col1, col2, col3) VALUES (@foo, @bar, @quux) UPDATE someother nonsense COMMIT TRAN
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Recoding a multi-sql-statement storedProc transaction in a script
by VSarkiss (Monsignor) on Dec 15, 2004 at 01:57 UTC | |
by punkish (Priest) on Dec 15, 2004 at 02:00 UTC |