question

Prashantgupta avatar image
Prashantgupta asked

Need help with Trigger Function

(Using AdventureWorks2012 database)

Create a procedure to update the product with a new name in Production.Product table for a given product id only if cost of product cost is greater than 100

CREATE PROCEDURE USP_PRODUCTRENAME(@NAME NVARCHAR(50), @PRODUCTID INT, @STANDARDCOST NUMERIC)

AS

BEGIN

UPDATE Production.Product

SET Name = @NAME

WHERE ProductID = 515

AND StandardCost >= 100;

END;

This is how i use stored procedure for product name update.

Can someone help me to Implement the same scenario through trigger function ?


sqlserver2012sqlserver2014
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.