19.09.2015 Views

Confessions of an IT Manager_Phil Factor

  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

162 On the Trail with the Cowboy Coders<br />

IF dbo.rcharindex (' without their ties on.',NULL)<br />

IS NOT NULL<br />

RAISERROR ('Failed the %s',16,1,@test)<br />

SET @Test='Sixth test'---------------------------<br />

IF dbo.rcharindex ('','')<br />

0<br />

RAISERROR ('Failed the %s',16,1,@test)<br />

SET @Test='Seventh test'---------------------------<br />

IF dbo.rcharindex ('','<strong>an</strong>d looking sincere')<br />

0<br />

RAISERROR ('Failed the %s',16,1,@test)<br />

SET @Test='Eighth test'---------------------------<br />

IF dbo.rcharindex ('but it adds to life''s rich humour','')<br />

0<br />

SET @Test='Ninth test'---------------------------<br />

IF dbo.rcharindex ('Klop','so perhaps one should be<br />

toler<strong>an</strong>t')<br />

0<br />

RAISERROR ('Failed the %s',16,1,@test)<br />

SET @Test='Tenth test'---------------------------<br />

IF dbo.rcharindex ('Klop','KlopKlopKlop ')<br />

9<br />

RAISERROR ('Failed the %s',16,1,@test)<br />

SET @Test='Eleventh test'---------------------------<br />

IF dbo.rcharindex (' Klop ','Klop Klop Klop ')<br />

10<br />

RAISERROR ('Failed the %s',16,1,@test)<br />

SET @Test='Twelveth test'---------------------------<br />

IF dbo.rcharindex (' ',' ')<br />

6<br />

RAISERROR ('Failed the %s',16,1,@test)<br />

SET @Test='Thirteenth test'---------------------------<br />

IF dbo.rcharindex (' ! ',' ! !!! ! !!! ')<br />

8<br />

RAISERROR ('Failed the %s',16,1,@test)<br />

There are m<strong>an</strong>y cleverer ways <strong>of</strong> doing it but I blush to think <strong>of</strong> the stupid<br />

bugs that this sort <strong>of</strong> system catches, that slip through casual testing.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!