17.07.2015 Views

Defensive Database Programming - Red Gate Software

Defensive Database Programming - Red Gate Software

Defensive Database Programming - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Chapter 1: Basic <strong>Defensive</strong> <strong>Database</strong> <strong>Programming</strong> TechniquesOldValue)SELECT 1 ,'SizeInInches' ,-- this means June 15th, 2009'20090615',12.3UNION ALLSELECT 1 ,'SizeInInches' ,-- this means September 15th, 2009'20090915',12.5SET LANGUAGE 'us_english' ;-- this call returns rows from Jul 6th to Sep 10th, 2009-- one log entry meets the criteriaEXEC SelectObjectsChangeLogForDateRange@DateFrom = '07/06/2009',@DateTo = '09/10/2009' ;SET LANGUAGE 'Norsk' ;-- this call returns rows from Jun 7th to Oct 9th, 2009-- three log entries meet the criteriaEXEC SelectObjectsChangeLogForDateRange@DateFrom = '07/06/2009',@DateTo = '09/10/2009' ;Changed language setting to us_english.ObjectID ChangedColumnName ChangedAt OldValue----------- -------------------- -----------------------1 SizeInInches 2009-07-07 12.34-- because the stored procedure does not have an ORDER BY-- clause, your results may show up in a different-- order41

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

Saved successfully!

Ooh no, something went wrong!