USP_ENABLEAUDIT
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@TABLENAME | varchar(128) | IN | |
@ENABLED | bit | IN |
Definition
Copy
create procedure dbo.USP_ENABLEAUDIT(@TABLENAME varchar(128), @ENABLED bit)
with execute as owner
as
begin
declare @VALUE int
select @VALUE = cast(value as int) from fn_listextendedproperty(N'BB_Audit', N'SCHEMA', N'dbo', N'table', @TABLENAME, default, default)
if @VALUE is null
-- add the property
exec sys.sp_addextendedproperty N'BB_Audit', @ENABLED, N'SCHEMA', 'dbo', N'table', @TABLENAME, default, default
else
-- the property already exists, so just update it
exec sys.sp_updateextendedproperty N'BB_Audit', @ENABLED, N'SCHEMA', 'dbo', N'table', @TABLENAME, default, default
end