Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Check constraint for Date in Ms Sql Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-06 : 00:45:04
Snehal writes "I am using MS SQL Server as the database and in that i have a date field whose type is smalldatetime. I need to put a constraint on that field such that the value of the field can be only the 1st or the 16th of any month and any year. There was some help in the MS SQL Server Help for adding constraints on existing tables. I have found the place where to apply the constraint ( Click the design table option of a table, right click the field which needs to have a constraint and click Properties. In the table option there is space for creating the constraint. ). The check constraints work with the other fields like int or else but seem to be having some syntax error with the date field check constraint. I have mentioned the specific constraint as well, so please suggest some good solutions.

Thanks,

Snehal"
   

- Advertisement -