Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CREATE TABLE [dbo].[pegawai](
[id] [int] IDENTITY(1,1) NOT NULL,
[nama] [varchar](20) NOT NULL,
[jenis_kelamin] [char](1) NOT NULL,
[create_at] [datetime] NOT NULL,
[update_at] [datetime] NOT NULL,
CONSTRAINT [PK_pegawai] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[pegawai] ADD CONSTRAINT [DF_pegawai_create_at] DEFAULT (getdate()) FOR [create_at]
GO
ALTER TABLE [dbo].[pegawai] ADD CONSTRAINT [DF_pegawai_update_at] DEFAULT (getdate()) FOR [update_at]
GO
CREATE TABLE [dbo].[pegawai_log](
[id] [int] IDENTITY(1,1) NOT NULL,
[id_pegawai] [int] NOT NULL,
[operasi] [varchar](50) NOT NULL,
[status] [varchar](10) NOT NULL,
[message] [varchar](50) NULL,
[create_at] [datetime] NOT NULL,
[update_at] [datetime] NOT NULL,
CONSTRAINT [PK_pegawai_log] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[pegawai_log] ADD CONSTRAINT [DF_pegawai_log_create_at] DEFAULT (getdate()) FOR [create_at]
GO
ALTER TABLE [dbo].[pegawai_log] ADD CONSTRAINT [DF_pegawai_log_update_at] DEFAULT (getdate()) FOR [update_at]
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.