Select dbo.GetDaysFromBString(‘0000001’) Output: Sunday Create function [dbo].[GetDaysFromBString](@DayBinaryString varchar(7)) returns varchar(250) as begin declare @Results varchar(250) --declare @DayBinaryString varchar(7); --set @DayBinaryString='1111111' --print @DayBinaryString ;with DaysSelected as (select […]