Hi, everyone. I need a help in stored procedure SQL. I want my stored procedure
ID: 3843621 • Letter: H
Question
Hi, everyone.
I need a help in stored procedure SQL.
I want my stored procedure check the data if data in column "Money" has any numbers like 573 and, not contains (.00) or (.any digit) after a 573, added a (.00) at end and update the table.
ca you guys help me for this, please?
Hi, everyone.
I need a help in stored procedure SQL.
I want my stored procedure to check the data if data in column "Money" has any numbers like 573 and, not contains (.00) or (.any digit) after a 573, added a (.00) at the end and update the table.
ca you guys help me for this, please?
Explanation / Answer
Find the stored procedure below.
USE testDB;
GO
CREATE PROCEDURE uspUpdateMoneyColumn
AS
BEGIN
UPDATE testTable
SET Money = ROUND(Money, 2)
WHERE Money in (SELECT Money FROM testTable WHERE NOT LIKE '%.%';)
END
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.