Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow the SQL Server default keyword as default value for a column #1207

Merged
merged 1 commit into from
Apr 18, 2021

Conversation

ahayanm001
Copy link
Contributor

Hi,

We use temporal tables to audit all the data changes.

When you do an insert, there are two special datetime2 columns (in a temporal table) declared as GENERATED ALWAYS AS ROW START/END. These columns are mandatory.

For some actions, like batch inserting, all columns need an explicit value. The columns mentioned above are automatically filled, and you cannot insert an explicit value into a GENERATED ALWAYS column.

You have a couple of options when inserting a new row in a temporal table like omitting the two columns or specify the DEFAULT keyword in the values list for both columns.

I've created a test that shows what we are trying to do and the suggested fix.

Other suggestions are welcome!

@ahayanm001 ahayanm001 force-pushed the work/default-keyword branch from c89a171 to ca264b5 Compare April 17, 2021 12:10
@Tapac Tapac merged commit f7b926b into JetBrains:master Apr 18, 2021
Tapac added a commit that referenced this pull request Apr 18, 2021
@ahayanm001 ahayanm001 deleted the work/default-keyword branch April 18, 2021 16:08
SchweinchenFuntik pushed a commit to SchweinchenFuntik/Exposed that referenced this pull request Oct 23, 2021
SchweinchenFuntik pushed a commit to SchweinchenFuntik/Exposed that referenced this pull request Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants