zoe*_*oe 19 t-sql sql-server triggers
我有以下触发器:
CREATE Trigger enroll_limit on Enrollments
Instead of Insert
As
Declare @Count int
Declare @Capacity int
Select @Count = COUNT(*) From Enrollments
Select @Capacity = Capacity From CourseSections
If @Count < @Capacity
Begin
Insert Into Enrollments Select * From Inserted
End
GO
Run Code Online (Sandbox Code Playgroud)
我收到一条错误消息说:
'CREATE TRIGGER'必须是查询批处理中的第一个语句.
Mit*_*eat 38
错误消息"'CREATE TRIGGER'必须是查询批处理中的第一个语句." 通常在前面的一组(批)语句没有终止时发生GO
所以,我建议GO在前一批的语句末尾添加一个add .
| 归档时间: |
|
| 查看次数: |
18298 次 |
| 最近记录: |