1234567891011121314151617181920212223242526272829303132333435CREATE FUNCTION [dbo].[fx_FormatUsingMask] ( -- Add the parameters for the function here @input nvarchar(1000), @mask nvarchar(1000))RETURNS nvarchar(1000)ASBEGIN -- Declare the return variable here DECLARE @result nvarchar(1000) = '' DECLARE @inputPos int = 1 DECLARE @maskPos int = 1 DECLARE @maskSign char(1) = '' WHILE @maskPos