USP_CONSTITUENCYCODESELECTION_DELETE
Deletes the Selection for the specified Constituency Code.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CONSTITUENCYCODEID | uniqueidentifier | IN |
Definition
Copy
create procedure dbo.USP_CONSTITUENCYCODESELECTION_DELETE
(
@CONSTITUENCYCODEID uniqueidentifier
)
as
set nocount on;
declare @FUNCTIONNAME nvarchar(256) = N'UFN_CONSTITUENCYCODESELECTION_' + replace(convert(nvarchar(36), @CONSTITUENCYCODEID), '-', '_');
declare @IDSETREGISTERID uniqueidentifier = null;
select
@IDSETREGISTERID = ID
from
dbo.IDSETREGISTER
where
DBOBJECTNAME = @FUNCTIONNAME;
if (@IDSETREGISTERID is not null)
exec dbo.USP_IDSETREGISTER_DELETEBYID_WITHCHANGEAGENTID @IDSETREGISTERID, null;
if (object_id(@FUNCTIONNAME) > 0)
begin
declare @SQL nvarchar(max) = N'drop function ' + @FUNCTIONNAME;
exec sp_executesql @SQL;
end