When you delete a card from a user, the card is sent to the unassigned card list in BioStar 2 at Setting > Card.


Currently, there isn't a UI to delete the cards on the unassigned card list. 

When you want to use the cards again you simply have to select the Assign Card at the Registration Option and select the card you used previously.



If you must delete the cards on the unassigned list you can delete CSN cards with the query shown below in your database management tool: 


start transaction; 

delete from t_usrcrd where crduid in (select crduid from t_crd where crdcsn= '12345678'); 
delete from t_crdisshis where crduid in (select crduid from t_crd where crdcsn='12345678'); 
delete from t_crd where crdcsn='12345678'; 

commit;



If you need to delete all unassigned card list, you can delete all unassigned cards with the query shown below in your database management tool:


DELETE FROM T_BLKL WHERE CRDUID IN (SELECT CRDUID FROM T_CRD WHERE CRDUID NOT IN (SELECT CRDUID FROM T_USRCRD));
DELETE FROM T_CRDISSHIS WHERE CRDUID IN (SELECT CRDUID FROM T_CRD WHERE CRDUID NOT IN (SELECT CRDUID FROM T_USRCRD));
DELETE FROM T_CRD WHERE CRDUID NOT IN (SELECT CRDUID FROM T_USRCRD);



Enter your card number between the ' '.


Else if you have BioStar 2.3 or above you can use the attached script.
Change the file extension to .bat and run with administrator privileges on the server PC.