public

Test script to create a dummy table to check SQL server 2012's AES crypto

  • Download Gist
TestSql2012AesEnc_CreateTable.sql
SQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
USE [TestDb]
GO
 
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CreditCard](
[CreditCardID] [int] IDENTITY(1,1) NOT NULL,
[CardType] [nvarchar](50) NOT NULL,
[CardNumber] [nvarchar](25) NOT NULL,
[ExpMonth] [tinyint] NOT NULL,
[ExpYear] [smallint] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_CreditCard_CreditCardID] PRIMARY KEY CLUSTERED
(
[CreditCardID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
 
GO
SET IDENTITY_INSERT [dbo].[CreditCard] ON
 
INSERT [dbo].[CreditCard] ([CreditCardID], [CardType], [CardNumber], [ExpMonth], [ExpYear], [ModifiedDate]) VALUES (1, N'SuperiorCard', N'1', 11, 2006, CAST(0x0000999A00000000 AS DateTime))
INSERT [dbo].[CreditCard] ([CreditCardID], [CardType], [CardNumber], [ExpMonth], [ExpYear], [ModifiedDate]) VALUES (2, N'Distinguish', N'1', 8, 2005, CAST(0x00009A1B00000000 AS DateTime))
INSERT [dbo].[CreditCard] ([CreditCardID], [CardType], [CardNumber], [ExpMonth], [ExpYear], [ModifiedDate]) VALUES (3, N'ColonialVoice', N'1', 7, 2005, CAST(0x00009A4300000000 AS DateTime))
GO
 
SET IDENTITY_INSERT [dbo].[CreditCard] OFF
ALTER TABLE [dbo].[CreditCard] ADD CONSTRAINT [DF_CreditCard_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.