June 11, 2010 at 3:57 am
Dear Experts,
At the moment of insert data into a table using a certain program I would like to check whether the value being input has been inserted before and if so block me. This is a validation from the database side. Am using SQL 2005.
Anyone here who has done SQL validations ? Any samples here ?
June 11, 2010 at 4:20 am
Please post table definitions, sample data and desired output. Read this to see the best way to post this to get quick responses.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 11, 2010 at 5:25 am
SQL validations typically are CONSTRAINTs, whether a UNIQUE constraint, or a CHECK constraint. you can also use triggers or even functions as a CHECK constraint...so the tools are there...but...
As Gail already said, without the specific details of what you want we can't offer anything helpful yet.
The details require the CREATE TABLE definitions so we know what you are talking about, along with INSERT INTO statements so we have example data to test against.
explaining the problem, like which specific column/value you are wanting to avoid duplicates with, along with the structure above, can give us all the tools which we need to give you a tested working example for you to test with and understand the concepts.
Lowell
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply