View Full Version : Converting Validation Rule to Trigger


jschjol
09-16-2005, 02:57 PM
I'm working on a project where I'm migrating the tables from an Access database to a SQL Server database. A few of the Access tables contain fields with validation rules. I'd like to keep this validation and I've read that the best way to do this is to create a trigger in SQL Server. Can someone give me a clue as to how to do this? Here's an example of a field and validation rule I need to convert:

Field Name: StatusCode
Data Type: Text
Field Size: 1
Validation Rule: "A" Or "B" Or "C" Or ""
Validation Text: Needs to be A, B or C

Thanks for your help!

Pat Hartman
09-16-2005, 06:10 PM
If you use the upsizing wizard, it will create the triggers for you. Otherwise, you will get a faster answer from an SQL server forum since the question has nothing to do with Access.

jschjol
09-17-2005, 11:48 AM
Thanks Pat - I'll go ask in the SQL Server forum.