2

Using a hybrid Access 2010 / SQL Server 2012 platform - (a solution in either application will work)

I have a table created with a Select Into ... statement.

Is there any way to have this table dynamically update itself (using the query that created it) whenever its data is accessed?

Specifically, we want to keep a list of customers with only one order (non-repeat customers). I have created a table that contains the ID of those customers (WHERE COUNT(orderID) = 1) using Select Into, but if one of those customers makes a new order, or a new customer who makes one order is created, then I want that data removed/added to the table dynamically.

So, is this possible, or do I have to remember to update the table myself whenever I use it?

4

1 回答 1

1

我有一个使用 Select Into ... 语句创建的表。[...] 有没有办法让该表在访问其数据时动态更新自身(使用创建它的查询)?

您所描述的是 SQL VIEW,在 Access 中也称为“(保存的)SELECT Query”。视图是一个虚拟表,每次访问时都会从其他表(或视图)动态检索其信息。视图不会在调用之间保存其结果,因此每次引用它时都会获得最新数据。查看是否可以使用 VIEW(在 SQL Server 中)或保存的 SELECT 查询(在 Access 中)来代替当前创建的临时表。

于 2013-09-19T13:52:04.943 回答