日期:2014-05-17 浏览次数:20465 次
CREATE TABLE [dbo].[T_SelectQuestionBank](
[questionsID] [int] IDENTITY(1024,1) NOT NULL,
[questionsContent] [varchar](5000) NULL,
[optionsA] [varchar](500) NULL,
[optionsB] [varchar](500) NULL,
[optionsC] [varchar](500) NULL,
[optionsD] [varchar](500) NULL,
[rightAnswer] [varchar](10) NULL,
[courseID] [int] NULL,
[knowledgePoint] [int] NULL,
[questionType] [int] NULL,
[imagePath] [varchar](5000) NULL,
[flag] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[T_CourseSchedule](
[ID] [int] NULL,
[courseName] [varchar](50) NULL,
[courseID] [int] NOT NULL,
[state] [int] NULL,
[flag] [int] NULL
) ON [PRIMARY]
GO
CREATE TRIGGER T_CourseSchedule_UpdateFlag更新语句:
ON T_CourseSchedule
AFTER UPDATE
AS
IF UPDATE([flag])
BEGIN
UPDATE T_SelectQuestionBank SET flag=1
END
GO
UPDATE T_CourseSchedule SET flag=1 WHERE courseID=5如何在触发器中相应获取传入的courseID作为更新条件?