If i understand you well, you can write SP to do that. For example:
CREATE PROCEDURE GetStock
@ItemNm INT, @RequestedQty INT
AS
BEGIN
DECLARE @AvailQty INT
SELECT @AvailQty = AvailQty
FROM StockMF
WHERE ItemNm = @ItemNm
IF (@AvailQty < @RequestedQty)
SELECT 'Not Enough' AS Information
ELSE
SELECT 'Enough' AS Information
END
How to call SP? Please see my
past anwers[
^].