Sentencing, Mr Justice Fulford told April Casburn she had been guilty of "a corrupt attempt to make money out of sensitive and potentially very damaging information".
The judge went on:
Activity of this kind is deeply damaging to the administration of criminal justice in this country.
It corrodes the public's faith in the police force, it can lead to the acquittal or the failure by the authorities to prosecute individuals who have committed offences whether they are serious or otherwise.
We are entitled to expect the very highest standards of probity from our police officers, particularly those at a senior level.
It is, in my judgment, a very serious matter indeed when men or women who have all the benefits, privileges and responsibilities of public office use their position for corrupt purposes.
He said he was particularly concerned about Casburn's child, and admitted that her absence while she is in prison could be damaging.
But he said that, had she not been arrested, the detective would have returned to work by now, and therefore the child would be cared for by others anyway.
More top news
Urban Outfitters has apologised for a 'red-stained' sweater bearing the logo of a US university where four students were shot dead in 1970.
Edinburgh's poet laureate has offered some words of reconciliation as Scotland prepares to vote on independence in just two days' time.
Temperatures will be on the rise in the next few days, with highs of 25C in the sunshine by Thursday, but do not expect clear blue skies.