Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何更正此语法,将规则 r1 创建为 @f <1000?
改用CHECK 约束,因为 CREATE RULE 已弃用?
说真的,我自 90 年代以来就没有使用过规则
您只需要删除 @ 和 f 之间的空格:
create rule r1 as @f < 1000
您还应该考虑改用检查约束,因为 Microsoft 已表示将从 SQL Server 的未来版本中删除规则