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>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
-- =============================================
|
||||
-- Author: <Author,,Name>
|
||||
-- Create date: <Create Date,,>
|
||||
-- Description: <Description,,>
|
||||
-- =============================================
|
||||
CREATE PROCEDURE [dbo].[fds__admin_removeconflicttables]
|
||||
@entitytype nvarchar(255)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
DECLARE @name nvarchar(255);
|
||||
IF RIGHT(@entitytype,1) <> 's'
|
||||
SET @entitytype = @entitytype + 's';
|
||||
|
||||
DECLARE db_cursor CURSOR FOR
|
||||
select [name] from sys.objects
|
||||
where LEFT(name,2) = 't_'
|
||||
order by create_date asc;
|
||||
|
||||
OPEN db_cursor
|
||||
FETCH NEXT FROM db_cursor INTO @name ;
|
||||
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
PRINT( @name);
|
||||
|
||||
IF LEFT(@name, 2) = 't_' and @name like ('%[_mfr__]%')
|
||||
BEGIN
|
||||
DECLARE @sql nvarchar(2000) = 'DROP TABLE [dbo].[' + @name + N'];';
|
||||
EXECUTE sp_executesql @sql, N'@name nvarchar(255)', @name;
|
||||
PRINT( @name + ' --> dropped');
|
||||
END
|
||||
|
||||
FETCH NEXT FROM db_cursor INTO @name
|
||||
END
|
||||
|
||||
CLOSE db_cursor
|
||||
DEALLOCATE db_cursor
|
||||
END
|
||||
Reference in New Issue
Block a user