Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote