Is it possible to update SQL Server 2016 temporary tables from Access?

I created a SQL Server 2016 database with a temporary table Product. I would like to update a table from an Access database through a linked table. When trying to do this Access reports

Reserved error (-7776): there is no error message for this error

The table is defined as:

CREATE TABLE [dbo].[Product]
(
    [Product] [uniqueidentifier] NOT NULL,
    CONSTRAINT PK_Product_Product PRIMARY KEY CLUSTERED (Product),
    [Name] [nchar](50) NOT NULL,
    CONSTRAINT [AK_Product_Name] UNIQUE([Product line], [Name]),
    [Status] [uniqueidentifier] NOT NULL,
    SysStartTime datetime2 GENERATED ALWAYS AS ROW START NOT NULL,
    SysEndTime datetime2 GENERATED ALWAYS AS ROW END NOT NULL,
    PERIOD FOR SYSTEM_TIME (SysStartTime, SysEndTime)     
) ON [PRIMARY] WITH    
   (   
      SYSTEM_VERSIONING = ON (HISTORY_TABLE = dbo.ProductHistory)   
   ) 
GO

Inquiry

UPDATE Product 
SET Status = (SELECT [Product status] 
              FROM [Product status]
              WHERE [Name] = 'Announced') 
WHERE [Name] = 'A300';

runs without error and is displayed in the Access table. Updates are correctly reflected in the History table.

I tried to hide valid time columns if changing them internally causes a problem, but without effect. Both tables Productand Product statusinclude minimum data.

Is there any specific way to make this work, or is this script not supported?

+4
1

datetime2(7) , Access. datetime2(3), .

, . , , .

SQL Server Profiler Valid time

exec sp_executesql N'UPDATE "dbo"."Product" 
    SET "Product status"=@P1  
    WHERE "Product line" = @P2 AND "Product" = @P3 AND 
        "Name" = @P4 AND "Product status" = @P5 AND "SysStartTime" = @P6 AND 
        "SysEndTime" = @P7',
    N'@P1 uniqueidentifier,@P2 uniqueidentifier,@P3 uniqueidentifier,@P4 nvarchar(50),@P5 uniqueidentifier,@P6 datetime2,@P7 datetime2',
    '3C...1E4B','38...2883','8E...0387',N'A300','44...6B76','2016-08-09 21:43:07.8710000','2016-08-09 22:45:59.1340000'

, - .

Product line Product   Name Product status SysStartTime                SysEndTime
38...2883    8E...0387 A300 44...6B76      2016-08-09 21:43:07.8709730 2016-08-09 22:45:59.1342223

BIGINT , #DELETED. SQL Server.

GUID , .

+2

Source: https://habr.com/ru/post/1650725/


All Articles