I am trying to create a temporal table in my SQL Server database. Is anyone familiar with this error in SQL Server:
Msg 2760, Level 16, State 1, Line 5 The specified schema name "items" either does not exist or you do not have permission to use it.
I think there may be something wrong with my user privileges. Any help would be great.
Here's the code:
CREATE TABLE [items].[items_Temporal](
[itemsID] [int] NOT NULL,
[item_Name] [varchar](50) NOT NULL,
[item_Number] [int] NOT NULL,
[item_Price] [float] NOT NULL,
ValidFrom datetime2(7) GENERATED ALWAYS AS ROW START HIDDEN NOT NULL,
ValidTo datetime2(7) GENERATED ALWAYS AS ROW END HIDDEN NOT NULL,
CONSTRAINT [PK_items_Temporal_items1ID] PRIMARY KEY CLUSTERED
(
[itemsID] ASC
),
PERIOD FOR SYSTEM_TIME(ValidFrom, ValidTo)
)
WITH(SYSTEM_VERSIONING = ON (HISTORY_TABLE = [items].[items_Temporal_History]));
Run below query to check actually your are trying to run query in database has item schema in it or not
If you have rows in above query then check login user from which you are trying to run this query. Also check does this user has rights to create table by this way you will have idea why this error is coming