diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2016-03-25 17:55:51 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2016-03-25 17:55:51 +0100 |
commit | a3388622287e218beddfa14a47ed677d4307b36b (patch) | |
tree | 1b4c7ac8597b1cc798b6683d4a81c90d38de12f6 /tests/unit/Data/SqlMap/scripts/mssql/swap-procedure.sql | |
parent | c7fd3e1167b6f2fa7746edbd0fb8f8c1694c61f9 (diff) |
Removed simpletest and moved all tests in the unit tree
Tests are executed now, but a lot of them need fixing.
Diffstat (limited to 'tests/unit/Data/SqlMap/scripts/mssql/swap-procedure.sql')
-rw-r--r-- | tests/unit/Data/SqlMap/scripts/mssql/swap-procedure.sql | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/unit/Data/SqlMap/scripts/mssql/swap-procedure.sql b/tests/unit/Data/SqlMap/scripts/mssql/swap-procedure.sql new file mode 100644 index 00000000..981ffc5f --- /dev/null +++ b/tests/unit/Data/SqlMap/scripts/mssql/swap-procedure.sql @@ -0,0 +1,34 @@ +CREATE PROCEDURE dbo.[ps_swap_email_address] +@First_Email [nvarchar] (64) output, +@Second_Email [nvarchar] (64) output +AS + +Declare @ID1 int +Declare @ID2 int + +Declare @Email1 [nvarchar] (64) +Declare @Email2 [nvarchar] (64) + + SELECT @ID1 = Account_ID, @Email1 = Account_Email + from Accounts + where Account_Email = @First_Email + + SELECT @ID2 = Account_ID, @Email2 = Account_Email + from Accounts + where Account_Email = @Second_Email + + UPDATE Accounts + set Account_Email = @Email2 + where Account_ID = @ID1 + + UPDATE Accounts + set Account_Email = @Email1 + where Account_ID = @ID2 + + SELECT @First_Email = Account_Email + from Accounts + where Account_ID = @ID1 + + SELECT @Second_Email = Account_Email + from Accounts + where Account_ID = @ID2 |