BaşlayınÜcretsiz Başlayın

Use SP to DELETE

Create a stored procedure named cuspRideSummaryDelete in the dbo schema that will delete an existing record in the RideSummary table and RETURN the number of rows affected via output parameter.

Bu egzersiz

Writing Functions and Stored Procedures in SQL Server

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Create a stored procedure called cuspRideSummaryDelete that accepts @DateParm as an input parameter and has an integer output parameter named @RowCountOut.
  • Delete the record(s) in the RideSummary table that have the same Date value as @DateParm.
  • Set @RowCountOut to @@ROWCOUNT to return the number of rows affected by the statement.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Create the stored procedure
CREATE PROCEDURE dbo.cuspRideSummaryDelete
	-- Specify @DateParm input parameter
	(___ ___,
     -- Specify @RowCountOut output parameter
     ___ ___ ___)
AS
BEGIN
-- Delete record(s) where Date equals @DateParm
___ FROM dbo.___
___ ___ = ___
-- Set @RowCountOut to @@ROWCOUNT
___ ___ = ___
END;
Kodu Düzenle ve Çalıştır