删除新闻及对其的评论

USE [Publishing System ]
GO
/****** Object:  StoredProcedure [dbo].[procnewsdelete]    Script Date: 05/12/2010 12:12:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:  韩慧
-- Create date: 2010-4-15 2:11
-- Description: 删除新闻
-- =============================================
ALTER PROCEDURE [dbo].[procnewsdelete]
 @id int
AS
BEGIN
 --需要先删除评论才能删除新闻
 delete comment where newsid=@id
 --删除新闻
 delete news where id=@id
END

你可能感兴趣的:(Go)