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

Reset fails in SQL Server when temporal table or history table are in non-default schemas #73

Closed
krivtom opened this issue Oct 23, 2020 · 0 comments · Fixed by #74
Closed
Milestone

Comments

@krivtom
Copy link
Contributor

krivtom commented Oct 23, 2020

I have a temporal table where both table and history table are in non-default (dbo) schema:

CREATE SCHEMA [TableSchema] AUTHORIZATION [dbo];
GO

CREATE SCHEMA [HistorySchema] AUTHORIZATION [dbo];
GO

create table TableSchema.Foo (
	Value [int] not null primary key clustered,
    ValidFrom datetime2 generated always as row start, 
    ValidTo datetime2 generated always as row end,
    period for system_time(ValidFrom, ValidTo)
) with (system_versioning = on (history_table = HistorySchema.FooHistory))
GO

If I try to reset the database:

var checkpoint = new Checkpoint();
checkpoint.CheckTemporalTables = true;
await checkpoint.Reset(_connection);

I get a SQL exception:

Cannot find the object "Foo" because it does not exist or you do not have permissions.
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 a pull request may close this issue.

2 participants