12. Let $\left\{a_{n}\right\}$ be an arithmetic sequence with all terms being positive integers, an odd number of terms, a non-zero common difference, and the sum of all terms equal to 2004. Then the value of the second term $a_{2}$ is $\qquad$
12. 668 .

Let the first term and common difference of an arithmetic sequence be $a$ and $d$, and the number of terms be $n$. Then, $n a+\frac{1}{2} n(n-1) d=2004$, which means
$$
[2 a+(n-1) d] n=2004 \times 2=2^{3} \times 3 \times 167 \text {. }
$$

Since $n$ is odd and $d \neq 0$,
when $n=501$, $a+250 d=4$, which does not meet the condition;
when $n=167$, $a+83 d=12$, which does not meet the condition;
when $n=3$, $a+d=4 \times 167=668$.
Therefore, $a_{2}=668$.