Skip to content

Instantly share code, notes, and snippets.

@sandeep540
Created June 9, 2020 12:35
Show Gist options
  • Save sandeep540/c2a88e01cf4e7181de04c724f5847082 to your computer and use it in GitHub Desktop.
Save sandeep540/c2a88e01cf4e7181de04c724f5847082 to your computer and use it in GitHub Desktop.
SQL Table and Log creation
CREATE TABLE [dbo].[Users]
(
[uuid] [uniqueidentifier] not null,
[firstname] varchar(256) null,
[lastname] varchar(256) null,
[age] int null,
[social] varchar(256) null,
[gender] varchar(10) null,
CONSTRAINT Users_Primary PRIMARY KEY (uuid)
)
GO
ALTER TABLE [dbo].[Users] ADD DEFAULT (newid()) FOR [uuid]
GO
CREATE TABLE [dbo].[Users_log]
(
[uuid] [uniqueidentifier] null,
[firstname] varchar(256) null,
[lastname] varchar(256) null,
[age] int null,
[social] varchar(256) null,
[gender] varchar(10) null,
[action] varchar(10) null,
[changeuser] varchar(100) null,
[modifiedOn] datetime null,
[VerCol] rowversion
)
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment