score:6
Am I allowed to have Netherlands as my first port of entry if I can prove I will go to Spain as scheduled within a few days?
Yes.
Or do I have to use Spain as my first port of entry?
No.
(another use case would be if I travel outside EU when I'm studying, do I have to go to Spain first or can I go to other EU as my port of entry?)
You can enter and exit the Schengen area through any port.
Second question is similar, can I leave EU at the end of my study from the Netherlands instead of Spain?
Yes.
Upvote:3
From personal experience as a traveller: yes, you can enter the Schengen area on a D visa through a different Schengen country, it does not have to be the country that issued the visa.
IANAL, but the Regulation (EC) No 562/2006, and a later amendment in the Regulation (EU) No 265/2010 seem to indicate that they have to let you transit to your destination country even in the absence of some requirements:
(a) third-country nationals who do not fulfil all the conditions* laid down in paragraph 1 but who hold a residence permit, a long-stay visa or a re-entry visa issued by one of the Member States or, where required, a residence permit or a long-stay visa and a re-entry visa, shall be authorised to enter the territories of the other Member States for transit purposes so that they may reach the territory of the Member State which issued the residence permit, long-stay visa or re-entry visa, unless their names are on the national list of alerts of the Member State whose external borders they are seeking to cross and the alert is accompanied by instructions to refuse entry or transit
* - having a valid passport, visa and justification for crossing the border