A secondary dominant is a chord that has been transformed to become a major or a dominant seventh chord. This chord will act as a temporary dominant of another chord. In major keys we can create secondary dominant chords of any degree, except the I, since it would be a simple dominant chord, and the VII since it is a diminished chord. Let's see an example...
Let's take this chord progression in the C major key and embellish it using secondary dominants:
First, let's prepare the IV degree chord by preceding it by it's dominant. The IV degree chord is F major and C7 is the dominant chord of F:
We write V / IV to indicate a secondary dominant of the IV degree. We refer to these chords as V of IV or V of V, etc.
Now, let's do the same with the V degree chord. The dominant chord of G is D7:
By using these secondary dominant chords we have added some harmonic interest to the original chord progression.
The first measures of Beethoven's first symphony are a good example of secondary dominants use. Note the use of secondary dominants of the IV and V degrees:
Here we show all the secondary dominant chords of all the degrees in the C major key:
Diminished seventh chords have a similar harmonic function. They too can be used as secondary diminished seventh chords. Here we show all the diminished seventh chords in C major: