当编写的SQL Server查询,你可以声明和使用变量是这样的:SQL查询变量
declare @test int
select @test = max(ID) from MyTable1
update MyTable2 set (...) where ID > @test
update MyTable3 set (...) where ID < @test
是否有申报和的MS Access编写查询时使用的变量同样的方式?
我需要用另一个查询的结果填充变量,然后使用该值执行插入/更新操作。该查询将从.NET应用程序运行。
在Access中,至少有2个查询。 – Fionnuala