dbo.fn_HorseProperty

Syntax:
dbo.fn_HorseProperty(id_horse, property)

Output:
(decimal) Returns properties of an horse.

Input parameters:
id_horse (integer)Id of the runner
property (string)Can return one of the following properties:
  • 'flag' = if 0 the horse has no flag, if 1 the horse has a red flag, if 2 the horse has a black flag
  • 'birth_year' = the birth year of the horse in the format yyyy
  • 'id_trainer' = Id of the trainer.
  • 'id_owner' = Id of the owner.
  • 'days_since_last_run' = Number of days elapsed from the last run
  • 'official_rating' = official rating

Example:

dbo.fn_horseproperty(@id_horse,'days_since_last_run')

Returns the number of days elapsed since the last run of the horse..