Welcome to Qlikview!!
I think the issue in your script is in the QVD load within the loop, you are missing the (qvd) syntax ...
if $(vQvdCardsExists) then
LOAD * from $(vQVDFolder)\$(vPrefix)Cards.QVD (qvd);
You might also need to change the where clause to CRD_ID >= $(i)
There may be a better way of doing this, though, using incremental load which will reduce the loop to something like ...
FOR i = $(vCardCountBegin) to $(vCardCountEnd) step 1000000
Buffer (Incremental) LOAD *;
SQL Select * from $(vDatabase).dbo.CRD where TRA_TRA_ID is not null and CRD_ID > $(i) and CRD_ID < ($(i) + 1000000);
STORE Cards into Cards.QVD (qvd);