USE [Publishing System ]
GO
/****** Object: StoredProcedure [dbo].[Procdeletesomenews] Script Date: 05/12/2010 10:07:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: 韩慧
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[Procdeletesomenews]
@delId nvarchar(200)
AS
BEGIN
--需要先删除评论才能删除新闻
--删除新闻
declare @deln nvarchar(4000)
declare @delc nvarchar(4000)
set @delc = 'delete from comment where newsid in ('+@delId+')' --定义sql语句
set @deln = 'delete from news where id in ('+@delId+')'
exec(@delc)
exec(@deln)
END