Subject Re: Length of String < 10 in SQL Statement - how?
Author Adam
Um, a bit of context, 500 records is definately not a big table. I
just did a quick test on my old PIII 600, with a table containing
20000 records, and it only took 2 seconds.

What Ann is referring to is not so much a once off data correction
operation that you are attempting, but if you planned on using that
sort of logic in a trigger or stored procedure is not going to be
very nice especially when the table gets bigger.

You should do something like this:

Your controls in your application should be in many cases moved into
consistency rules, by creating triggers to disallow future inserts /
updates of bad data. Decide what you are going to do with the
existing dirty data (delete it or null it etc), and "fix it".

Obviously, your client application should enforce where possible (ie
set the maxlength properties on any edit box component etc), but you
may not be thinking one day and create a program that lets users do
the wrong thing if you don't implement the constraints using triggers
or constraints (depending on the rule)


--- In, "hi_feroz" <hi_feroz@y...>
> hint, on a big table, it's going to be
> > dreadful.
> >
> Ann,
> I am in the midst of developing a small Library System which has
> BOOKS_MST as the Library Material Master. A gave them a part of
> application where they can start entering data into BOOKS_MST. At
> that time, it was not decided yet what and how long the barcode is
> going to be. So, I had not put any control in the application side
> yet. Then it was decided to be String(10). Barcode scanners are yet
> to be received, so they are entering barcodes manually as well. And
> found that some of the barcodes have been entered incorrectly. Just
> wanted to find out a quick way to get wrong barcodes.
> So, do u have any suggestions in this case?
> I have already put few controls in my application now... so I guess
> data entry errors are much reduced. But there are some records in
> those 500 records where the barcode entered is wrong.
> Current Records = 500
> Total Current Meterial in Library = 3000
> Total Material to be expected in Library by April = 30,000
> Total Material to be expected in Library by December = 90,000
> Feroz