Back to OIM Explorer

dbo.QBM_FCVStringToReplicate

Scalar FunctionSQL_SCALAR_FUNCTIONSandbox DB

Scalar Function.

Source: sandbox-db sys.sql_modules

Source size: 398 characters

Interpretation

  • Database function. Usually supports views, validation, or calculated predicates; look at referenced-by entries for callers.

Relations

  • No extracted relations.

Typed Edges

  • references source dbo.QBM_FCVIntToString source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL24 lines
1CREATE FUNCTION dbo.QBM_FCVStringToReplicate(2  @Element nvarchar(max),3  @Count int4) RETURNS nvarchar(max5)6AS7BEGIN8  DECLARE @erg nvarchar(max) = ''9  DECLARE @i int = 110  IF ISNULL(@count,11  0) < 1 OR @Element IS NULL12  BEGIN13    GOTO endlabel14  END15  WHILE @i <= @Count16  BEGIN17    SELECT18      @erg = CONCAT(@erg,19      REPLACE(@Element, '@i@', dbo.QBM_FCVIntToString(@i)))20    SELECT @i+=121  END22  endLabel:23  RETURN(@erg)24END
Open raw exported source
SQL ยท Raw4 lines
1   create   function dbo.QBM_FCVStringToReplicate(@Element nvarchar(max) , @Count int ) returns nvarchar(max) as begin declare @erg nvarchar(max2) = '' declare @i int = 1 if ISNULL(@count, 0) < 1 or @Element is null begin goto endlabel end while @i <= @Count begin select @erg = concat(@erg , REPLACE3(@Element , '@i@', dbo.QBM_FCVIntToString(@i))) select @i+=1 end endLabel: return (@erg) end 4