首页 > 代码库 > 存储过程 字段名为变量

存储过程 字段名为变量

ALTER PROCEDURE [dbo].[News_Update_is]

-- Add the parameters for the stored procedure here

@Newsid bigint,

@col nvarchar(50)

AS

BEGIN

-- SET NOCOUNT ON added to prevent extra result sets from

-- interfering with SELECT statements.

SET NOCOUNT ON;


exec(‘update  newsclass set ‘+@col+‘=-‘+@col+‘ where NewsClassid=‘+@Newsid)


END


存储过程 字段名为变量