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'
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.
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]