Does Sql Server ce Suports Check Constraints? I wanted to do something like "ALTER TABLE WITH NOCHECK ADD CONSTRAINT id_range_check CHECK ( BETWEEN and )
and this will give an error on 'WITH'
Does Sql Server ce Suports Check Constraints? I wanted to do something like "ALTER TABLE WITH NOCHECK ADD CONSTRAINT id_range_check CHECK ( BETWEEN and )
and this will give an error on 'WITH'
SQL Server Compact does not support CHECK constraint http://technet.microsoft.com/en-us/library/ms174123(v=sql.110).aspx
My experience is that CHECK CONSTAINT is not supported by SQL CE 3.5. The following code works (I originally had WITH CHECK but that failed):
ALTER TABLE [SiteUser] ADD CONSTRAINT [FK_SiteUser_Site] FOREIGN KEY([SiteId])
REFERENCES [Site] ([SiteId])
The following execution also fails.. so now it seems I can create the foreign key but can't enforce it.. what's the point then!?
ALTER TABLE [SiteUser] CHECK CONSTRAINT [FK_SiteUser_Site]
"alter table [table_name] check constraint [constraint_name]" is a constraint validation statement, not a check constraint.
Check constraints are supported, but the "WITH NOCHECK
" option is not. Try removing that.
I believe only simple constraints are supported your example above include a BETWEEN that would not be supported.