
ProTech-Online.com
Microsoft SQL code example for create credit card database table.
USE [sans]
GO
/****** Object: Table [dbo].[cards] Script
Date: 10/19/2011 11:05:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[cards](
[cardid] [int] IDENTITY(1,1) NOT NULL,
[userid] [nvarchar](256) NOT NULL,
[cardnumber] [varchar](500) NOT NULL,
[lastfour] [varchar](4) NOT NULL,
[privatekey] [varchar](1024) NOT NULL,
[publickey] [varchar](1024) NOT NULL,
CONSTRAINT [PK_cards] PRIMARY KEY CLUSTERED
(
[cardid] 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 ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[cards] WITH CHECK ADD CONSTRAINT [FK_cards_aspnet_Users] FOREIGN KEY([userid])
REFERENCES [dbo].[aspnet_Users] ([UserName])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[cards] CHECK CONSTRAINT [FK_cards_aspnet_Users]
GO
Copyright © 2013 ProTechs-Online.com; All rights reserved.