• 0

[SQL] Database validation according specific criteria


Question

Hi there,

My question might seem a little complicated, i'll try my best to explain. I'm looking for software or some sort of method that allows me to validate data entered in a database. What i want to do is make sure that (for example) if field1 is 1 then field2 can't be null, field3 can only be between 1 and 10. I know that a query or stored procedure might do the trick, but i'm looking for something that is easier to manage, as i have to do this for various tables, all with hundreds of fields. This is in mssql btw.

Thanks for any help,

phire

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

MSSQL comes with its own methods of validation, also you could validate the data before entry in either the app/website that is going to load the data, or within the stored procedure which loads the data.

My suggestion would be to pick the method you'd like to use, and do some research on it using the holyness that is Google.

Link to comment
Share on other sites

  • 0

i don't really know what you are expecting here... but a query or stored procedure with your desired logic will likely be the best solution.

Even though they are not my favourite thing, a trigger could be useful here in that when all of your criteria are not met you can just roll back the transaction, whether it be insert update or delete... although you prob won't have to worry about delete

best i got! ;)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.