update encryption method
USE [DellPII]
GO
/****** Object: StoredProcedure [dbo].[sp_isencryptupdate] Script Date: 3/29/2022 10:56:34 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_isencryptupdate]
@TableName sysname,
@ClientID nvarchar(1),
@joincolumn nvarchar(100),
@message ntext output
AS
BEGIN
declare @sql nvarchar(max);
Begin Try
set @sql = 'Update ' + @TableName + ' set '+ 'IsEncrypt = 1'
+' from [dbo].[vw_UCAREPII_TXNS] vw inner join dbo.'+@tablename+' as a on vw.incident_number=a.'+@joincolumn+
' where vw.clientid='+@clientid +' and a.Isencrypt <> 1';
print(@sql)
BEGIN
exec sp_executesql @sql ;
END
end TRY
Begin Catch
set @message='cursor2'+error_message()
End catch
END
GO
Comments
Post a Comment