views:

38

answers:

2

How can I correct this syntax , create rule r1 as @ f <1000 ?

+2  A: 

Use a CHECK constraint instead because CREATE RULE is deprecated?

Seriously, I've not used a rule since the 90s

gbn
A: 

You just need to remove the space between the @ and f:

create rule r1 as @f < 1000

You should also consider using a check constraint instead, as Microsoft have indicated that rules will be removed from future versions of SQL Server

Dexter