C
cansum
Unregistered / Unconfirmed
GUEST, unregistred user!
以下是两个表:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[adjust_price]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[adjust_price]
GO
CREATE TABLE [dbo].[adjust_price] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[upc] [int] NOT NULL ,
[date] [datetime] NOT NULL ,
[oriprice] [money] NOT NULL ,
[adprice] [money] NOT NULL
) ON [PRIMARY]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Item3]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Item3]
GO
CREATE TABLE [dbo].[Item3] (
[UPC] [int] IDENTITY (1, 1) NOT NULL ,
[Price] [money] NOT NULL
) ON [PRIMARY]
GO
希望在Item3表中的price表修改时,能够在adjust_price表中生成相应的记录:
upc 对应item3表中修改price的upc
[date] 为修改日期
oriprice 为修改前的price
adprice 为修改后的price
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[adjust_price]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[adjust_price]
GO
CREATE TABLE [dbo].[adjust_price] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[upc] [int] NOT NULL ,
[date] [datetime] NOT NULL ,
[oriprice] [money] NOT NULL ,
[adprice] [money] NOT NULL
) ON [PRIMARY]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Item3]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Item3]
GO
CREATE TABLE [dbo].[Item3] (
[UPC] [int] IDENTITY (1, 1) NOT NULL ,
[Price] [money] NOT NULL
) ON [PRIMARY]
GO
希望在Item3表中的price表修改时,能够在adjust_price表中生成相应的记录:
upc 对应item3表中修改price的upc
[date] 为修改日期
oriprice 为修改前的price
adprice 为修改后的price