Warning: Trying to access array offset on false in /home/selmanal/public_html/wp-content/plugins/postman-smtp/Postman/PostmanOAuthToken.php on line 45

Warning: Trying to access array offset on false in /home/selmanal/public_html/wp-content/plugins/postman-smtp/Postman/PostmanOAuthToken.php on line 46

Warning: Trying to access array offset on false in /home/selmanal/public_html/wp-content/plugins/postman-smtp/Postman/PostmanOAuthToken.php on line 47

Warning: Trying to access array offset on false in /home/selmanal/public_html/wp-content/plugins/postman-smtp/Postman/PostmanOAuthToken.php on line 48
MSSQL Server stored procedure – Selman ALPDÜNDAR

Selman ALPDÜNDAR

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



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.