Yes, you can. Holders of
- a Schengen visa (text on the visa reads "valid for Schengen states")
- a residence permit of a member state or
- a national visa (D-visa)
can stay in the entire Schengen area for up to 90 days in any period of 180 days. The Schengen area consists of the following countries:
Germany, Austria, Belgium, Czech Republic, Denmark, Estonia, Finland, France, Greece, Hungary, Iceland, Italy, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, the Netherlands, Norway, Poland, Portugal, Slovakia, Slovenia, Spain, Sweden and Switzerland.
The Schengen visa has to be applied for at the foreign mission of the country which is the main destination. The country of entry and departure is not the determining factor. The entry into and departure from the Schengen area can thus occur at any border crossing.