summaryrefslogtreecommitdiff
path: root/tests/unit/SQLMap/scripts/mssql/account-init.sql
diff options
context:
space:
mode:
authorwei <>2006-04-14 11:23:56 +0000
committerwei <>2006-04-14 11:23:56 +0000
commitf6a5e7589396854e10e023c25237b47e512ff047 (patch)
tree2b313bb8b66869235ee06b9cae2af2f7645cf5c9 /tests/unit/SQLMap/scripts/mssql/account-init.sql
parent3d3f8d3832921f99daf8ce1953304763c2e76c62 (diff)
Adding SQLMap unit tests. Allow sqlmap to use Prado's caching module to cache records.
Diffstat (limited to 'tests/unit/SQLMap/scripts/mssql/account-init.sql')
-rw-r--r--tests/unit/SQLMap/scripts/mssql/account-init.sql47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/unit/SQLMap/scripts/mssql/account-init.sql b/tests/unit/SQLMap/scripts/mssql/account-init.sql
new file mode 100644
index 00000000..8334798b
--- /dev/null
+++ b/tests/unit/SQLMap/scripts/mssql/account-init.sql
@@ -0,0 +1,47 @@
+-- Creating Table
+
+use [IBatisNet]
+
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Accounts]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
+BEGIN
+ if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_Orders_Accounts]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
+ ALTER TABLE [dbo].[Orders] DROP CONSTRAINT FK_Orders_Accounts
+
+ drop table [dbo].[Accounts]
+END
+
+CREATE TABLE [dbo].[Accounts] (
+ [Account_ID] [int] NOT NULL ,
+ [Account_FirstName] [varchar] (32) NOT NULL ,
+ [Account_LastName] [varchar] (32) NOT NULL ,
+ [Account_Email] [varchar] (128) NULL,
+ [Account_Banner_Option] [varchar] (255),
+ [Account_Cart_Option] [int]
+) ON [PRIMARY]
+
+ALTER TABLE [dbo].[Accounts] WITH NOCHECK ADD
+ CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED
+ (
+ [Account_ID]
+ ) ON [PRIMARY]
+
+-- Creating Test Data
+
+INSERT INTO [dbo].[Accounts] VALUES(1,'Joe', 'Dalton', 'Joe.Dalton@somewhere.com', 'Oui', 200);
+INSERT INTO [dbo].[Accounts] VALUES(2,'Averel', 'Dalton', 'Averel.Dalton@somewhere.com', 'Oui', 200);
+INSERT INTO [dbo].[Accounts] VALUES(3,'William', 'Dalton', null, 'Non', 100);
+INSERT INTO [dbo].[Accounts] VALUES(4,'Jack', 'Dalton', 'Jack.Dalton@somewhere.com', 'Non', 100);
+INSERT INTO [dbo].[Accounts] VALUES(5,'Gilles', 'Bayon', null, 'Oui', 100);
+
+-- Store procedure
+
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ps_InsertAccount]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[ps_InsertAccount]
+
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ps_SelectAccount]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[ps_SelectAccount]
+
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ps_swap_email_address]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[ps_swap_email_address]
+
+