存储过程:
ALTER PROC [dbo].[Inventory_Snapshot_Create]
AS
SET NOCOUNT ON
DECLARE @Inventory_Snapshot_ID int
INSERT INTO Inventory_Snapshots (snapshot_timestamp)
VALUES (GETDATE())
SET @Inventory_Snapshot_ID = SCOPE_IDENTITY()
INSERT INTO Inventory_Snapshot_Products (inventory_snapshot_id,
idProduct, stock)
SELECT @Inventory_Snapshot_ID, idProduct, stock
FROM products
SET NOCOUNT OFF
尝试执行存储过程的代码:
Dim db As New MilkModel
db.Inventory_Snapshot_Create()