Einträge von AZConAdmin

Abfrage der SSID DB im SQL Server

SELECT TOP 10 [statistics_id]         ,[execution_id]         ,[executable_id]         ,[execution_path]         ,[start_time]         ,[end_time]         ,[execution_duration]  ,[execution_duration]/60000 As Delta         ,[execution_result]         ,[execution_value]     FROM [SSISDB].[catalog].[executable_statistics]     where year(start_time) […]

ID oder Nr aus String ausschneiden

SUBSTRING(referenceText, PATINDEX(‘%[0-9]%’, referenceText), PATINDEX(‘%[0-9][^0-9]%’, referenceText + ‘t’) – PATINDEX(‘%[0-9]%’,                      referenceText) + 1) AS Kostenstelle,

delete old files ab älter x Tage

forfiles -p “C:ExporteCognosDonBoscoMission” -s -m *.pdf -d -30 -c “cmd /c del @PATH” forfiles -p “C:ExporteCognosDonBoscoMission” -s -m *.xml -d -30 -c “cmd /c del @PATH” forfiles -p “C:ExporteCognosDonBoscoMission” -s -m *.mht -d -30 -c “cmd /c del @PATH”

delete und copy file

del “D:DBV DatenAZNTransfer*.txt” xcopy  \Dbm-svssvsImportAZNKunden_Verlag_*.txt   “D:DBV DatenAZNTransfer” xcopy  \Dbm-svssvsImportAZNTest.txt   “D:DBV DatenAZNTransfer”

Defragmentierung von Indexen

SELECT  –DB_ID(‘Live_Staging’) DB_NAME(database_id) ,* –SELECT stats.index_id as id, name, avg_fragmentation_in_percent FROM sys.dm_db_index_physical_stats (DB_ID(N’Live_DWH ‘), NULL, NULL, NULL, NULL) AS stats     JOIN sys.indexes AS indx ON stats.object_id = indx.object_id       AND stats.index_id = indx.index_id AND name IS NOT NULL where database_id =6   –where name = ‘idx_customerCredit_customer_endamount’     –where name = […]

Fehler Cognos Firewall Edge Browser

Einstellungen -> Datenschutz, Suche und Dienste -> Browserdaten löschen -> Zu löschende Elemente auswählen -> Zeitbereich bitte auf ‚gesamxte Zeit‘ -> Haken gesetzt bei ‚Cookies und andere Website Daten‘ und ‚Zwischengespeicherte Bilder und Dateien‘ Dann -> Jetzt löschen

CHAR Übersetzung in SQL String finden

SET TEXTSIZE 0; — Create variables for the character string and for the current — position in the string. DECLARE @position INT, @string CHAR(8); — Initialize the current position and the string variables. SET @position = 1; SET @string = ‘New Moon’; WHILE @position <= DATALENGTH(@string) BEGIN SELECT ASCII(SUBSTRING(@string, @position, 1)), CHAR(ASCII(SUBSTRING(@string, @position, 1))) SET […]

Auflösen von JSON in SQL

select REPLACE(ShipAddr,””,‘”‘),        case when ISJSON(REPLACE(ShipAddr,””,‘”‘)) = 1 then JSON_VALUE(REPLACE(ShipAddr,””,‘”‘), ‘$.Line1’) else NULL end asLine1,        case when ISJSON(REPLACE(ShipAddr,””,‘”‘)) = 1 then JSON_VALUE(REPLACE(ShipAddr,””,‘”‘), ‘$.Line2’) else NULL end asLine2,        case when ISJSON(REPLACE(ShipAddr,””,‘”‘)) = 1 then JSON_VALUE(REPLACE(ShipAddr,””,‘”‘), ‘$.City’) else NULL end as City,        case when ISJSON(REPLACE(ShipAddr,””,‘”‘)) = 1 then JSON_VALUE(REPLACE(ShipAddr,””,‘”‘), ‘$.Country’) else NULL end asCountry,        case when ISJSON(REPLACE(ShipAddr,””,‘”‘)) = 1 then JSON_VALUE(REPLACE(ShipAddr,””,‘”‘), ‘$.CountrySubDivisionCode’)else NULL end as CountrySubDivisionCode,        case when ISJSON(REPLACE(ShipAddr,””,‘”‘)) = 1 then JSON_VALUE(REPLACE(ShipAddr,””,‘”‘), ‘$.PostalCode’) else NULL endas PostalCode from PY_Invoice