From f6a5e7589396854e10e023c25237b47e512ff047 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Fri, 14 Apr 2006 11:23:56 +0000
Subject: Adding SQLMap unit tests. Allow sqlmap to use Prado's caching module
 to cache records.

---
 tests/unit/SQLMap/scripts/mssql/swap-procedure.sql | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 tests/unit/SQLMap/scripts/mssql/swap-procedure.sql

(limited to 'tests/unit/SQLMap/scripts/mssql/swap-procedure.sql')

diff --git a/tests/unit/SQLMap/scripts/mssql/swap-procedure.sql b/tests/unit/SQLMap/scripts/mssql/swap-procedure.sql
new file mode 100644
index 00000000..203ab60d
--- /dev/null
+++ b/tests/unit/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
-- 
cgit v1.2.3

