Does SQL Server 2008 support the CREATE ASSERTION syntax?

点点圈 提交于 2019-12-19 03:42:07

问题


Does SQL Server 2008 support the CREATE ASSERTION syntax?

I haven't been able to find a straight answer on this.


回答1:


No SQL Server 2008 does not support this syntax.




回答2:


No, you'd use a CHECK constraint or a TRIGGER instead, depending on complexity.

  • CHECK constraint: at the row level only
  • TRIGGER: across rows or using other tables



回答3:


SQL Server 2008 does not support CREATE ASSERTION.

In fact, no current SQL products support CREATE ASSERTION properly. Sybase SQL Anywhere supports it but reportedly has problems allowing constraints to sometimes be violated. Rdb did support it when it was looked after by DEC (who apparently were influential in the early days of the SQL standards, probably the reason why CREATE ASSERTION is in the standard in the first place) but that product is no more.

STOP PRESS: according to their documentation, HyperSQL (HSQLDB) supports assertions (though I'm left wondering why they don't shout about it on their list of features).



来源:https://stackoverflow.com/questions/4130039/does-sql-server-2008-support-the-create-assertion-syntax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!