Files
Stefan 10ecdfa2e4 Add Fuchs_Database SSDT project (schema source of truth)
Adds the SQL Server Data Tools project for the fuchs_fds database — tables,
table types, functions and stored procedures that the backend calls (e.g.
fds__getInvoice, fds__merge_bankingtransactions, fds__tt__bankingtransactions,
fds__admin_getReportCatalog, fis_* auth). Build/model caches (bin, obj,
*.dbmdl, *.jfm, *.user) are git-ignored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 14:50:54 +02:00

30 lines
598 B
Transact-SQL

CREATE FUNCTION [dbo].[string_SplitString_ordered]
(
@String VARCHAR(MAX) ,
@Delimiter VARCHAR(10)
)
RETURNS @RetTable TABLE(
String varchar(MAX),
RowNo int
)
AS
BEGIN
DECLARE @i INT ,
@j INT ,
@cnt INT
SELECT @i = 1
SET @cnt = 1
WHILE @i <= LEN(@String)
BEGIN
SELECT @j = CHARINDEX(@Delimiter, @String, @i)
IF @j = 0
BEGIN
SELECT @j = LEN(@String) + 1
END
INSERT INTO @RetTable SELECT SUBSTRING(@String, @i, @j - @i), @cnt
SET @cnt = @cnt + 1
SELECT @i = @j + LEN(@Delimiter)
END
RETURN
END