Files
DP44/DataPRO_sql/dbo.Alter_foo_GetIdenticalGroupChannelSettingsCount.sql
2026-04-17 14:55:32 -04:00

31 lines
1.2 KiB
Transact-SQL
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
USE [DataPRO]
GO
/****** Object: UserDefinedFunction [dbo].[foo_GetIdenticalGroupChannelSettingsCount] Script Date: 4/2/2019 2:43:11 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[foo_GetIdenticalGroupChannelSettingsCount]
(
@ChannelId1 BIGINT,
@ChannelId2 BIGINT
)
RETURNS int
AS
BEGIN
return (
SELECT COUNT(*)
FROM [dbo].[GroupChannelSettings] G1,
[dbo].[GroupChannelSettings] G2
WHERE G1.ChannelId = @ChannelId1
AND G2.ChannelId = @ChannelId2
AND G1.SettingId = G2.SettingId
AND G1.SettingValue = G2.SettingValue
)
END