SQL Declare kullanımı

DECLARE @BARCODE VARCHAR(30)='005733165'

SELECT WAREHOUSE,STOCKPLACE,MATERIAL,QUANTITY,QUNIT,QPOSTWAY Q
,CREATEDAT C,CREATEDBY 
FROM IASINVITEM WITH (NOLOCK)
WHERE CONFIRMATION=SUBSTRING(@BARCODE,1,8) 
AND CONFIRMPOS=SUBSTRING(@BARCODE,9,5)
AND ISCANCELED=0 
ORDER BY CREATEDAT, QPOSTWAY DESC;
  
SELECT * FROM PNTFDIKISOTOB WHERE CONFMA=@BARCODE;