MSSQL Server stored procedure
CREATE PROCEDURE ProductInsert( @ProductName varchar(25), @Price int, @ProductInStock int) AS IF EXISTS(SELECT * FROM PRODUCTS WHERE ProductName=@ProductName) BEGIN PRINT 'This product already there is '; END ELSE BEGIN INSERT INTO PRODUCTS (ProductName,Price,ProductInStock) VALUES (@ProductName,@Price,@ProductInStock) END