Created
June 9, 2020 12:35
-
-
Save sandeep540/c2a88e01cf4e7181de04c724f5847082 to your computer and use it in GitHub Desktop.
SQL Table and Log creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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