#################################################################################################### # Digital Data Configuration File (Template Date: 30.07.2016) # # UTF-8 Coding required! # # incl. FailSafe functions that are active when information is missing. # #################################################################################################### #==================================================================================================# ########################################## General Setup ########################################### #==================================================================================================# #################################################################################################### # Path in which the log files will be stored. # # Example: E:\LogFiles\ # # FailSafe Setting is: \Logs # #################################################################################################### LogPath = #################################################################################################### # Numerical value how long (in days) log files will be kept. ValidateRange is 0 - 1000 # # Setting the Value to 0 disables this Function. # # FailSafe Setting is: 60 # #################################################################################################### LogFileKeepTime = 30 #################################################################################################### # Numerical value how long (in Minutes) a File has to be there, before processing it. # # FailSafe Setting is: 5 # #################################################################################################### FileDelayAge = 1 #==================================================================================================# ######################################## Database settings ######################################## #==================================================================================================# #################################################################################################### # Set the type of database Server # # Example: MSSQL # #################################################################################################### DBType = MSSQL #################################################################################################### # Set the database connection string. # # For help, visit https://www.connectionstrings.com/ # # IMPORTANT: mask ";" with a "\" = "\;" # # Example: "Data Source=SERVERNAME\INSTANCE\;Initial Catalog=DD_ECM\;Trusted_Connection=True\; # # TrustServerCertificate=true\;" # # Example: "Data Source=SERVERNAME\INSTANCE\;Initial Catalog=DD_ECM\;User Id=SQLUSERNAME\; # # Password=SQLPASSWORD\;TrustServerCertificate=true\;" # #################################################################################################### #DBConnString = "Data Source=S-ZLSDMS-DB1\;Initial Catalog=DD_ECM\;Trusted_Connection=True\;TrustServerCertificate=true\;" DBConnString = "Data Source=SDD-VMP04-SQL17\DD_DEVELOP01\;Initial Catalog=DD_ECM\;Trusted_Connection=True\;TrustServerCertificate=true\;" #==================================================================================================# ########################################## Profile Setup ########################################### #==================================================================================================# #################################################################################################### # In the following section(s), it is possible to use multiple variables in File and Folder Paths, # # in SQL Statements as well and other data related specifications. # # # # = # # %USERNAME% = The current User Name running this Script # # %USERDOMAIN% = The current Domain Name, User is logged on # # %COMPUTERNAME% = The Computername on which this Script is running # # %LOGONSERVER% = The currently connected Domain Controller # # %SCAN%& = Scan Tag for Batch scanning, will be replaced with - nothing # # %DATE% = Get Date in this Format: dd.MM.yyyy # # %TIMESTAMP1% = Get Date in this Format: ddMMyyyy # # %TIMESTAMP2% = Get Date and Time in this Format: ddMMyyyy_HHmmss # # %TIMESTAMP3% = Get Date and Time in this Format: ddMMyyyy_HHmmssffff # # %TIMESTAMP4% = Get Date and Time in this Format: yyyyMMdd HHmmssfff # # %TIMESTAMP5% = Get Date and Time in this Format: yyyyMMdd_HHmmss # # %TIMESTAMP6% = Get Date in this Format: dd.MM.yyyy # # %TIMESTAMP7% = Get Date and Time in this Format: dd.MM.yyyy_HH:mm:ss # # %TIMESTAMP8% = Get Date and Time in this Format: dd.MM.yyyy_HH:mm:ss.ffff # # %TIMESTAMP9% = Get Date and Time in this Format: yyyy/MM/dd HH:mm:ss.fff # # %TIMESTAMP10% = Get Date and Time in this Format: yyyy/MM/dd HH:mm:ss # #--------------------------------------------------------------------------------------------------# # Additional Variables specific for this Script are: # # %SourceFile% = Name of the processed File, including its Extension # # %SourceFilePath% = Directory of the processed File # # %SourceFileFullName% = Directory and Name of the processed File, including its Extension # # # # This dump table is matching with Function: "Update-ReplacePlaceholder-withLogging" # # Version Number: 1.0.0.0 / Version Date: 25.10.2018 # #################################################################################################### #################################################################################################### # Define Profiles in this config file for the executing Script. # # Syntax: # # Profile = ; ; ; ; ; # # ; ; # # Example: # # Profile = BulkImport ; e:\SourceFile.csv # # Profile = CheckSQLQuery ; SQL Statement (SELECT) # # Profile = InitialSQLQuery ; SQL Statement (SELECT, INSERT, UPDATE) # # Profile = PreparingSQLQuery ; SQL Statement (SELECT, INSERT, UPDATE) # # Profile = MainLoopSQLQuery ; SQL Statement (INSERT, UPDATE) # # Profile = FinalSQLQuery ; SQL Statement (SELECT, INSERT, UPDATE) # #--------------------------------------------------------------------------------------------------# # First Parameter: # # Set the way, Script is reading the SourceFile. # # Currently only the BulkImport is available. # # Example: BulkImport # #--------------------------------------------------------------------------------------------------# # Second Parameter: # # Set the full path and name to the file which includes the list you want to Import. # # Make sure, file is .csv and value separation is done by ";". # # Example: E:\UserList.csv # #--------------------------------------------------------------------------------------------------# # Optional Parameter: %ImportPathAD=,, # # Determ the TargetPath in your Active Directory (part of the distinguishedName). # # If you dont use this Parameter, TargetPath will be the "Users" Folder by default. # # Example: OU=Testuser,DC=domainname,DC=local # #--------------------------------------------------------------------------------------------------# # Optional Parameter: %ReportFile=\.csv # # By setting this Parameter, you get a overview file, which includes every created User, # # with all available data (UserName, PreName, Surname, Password ...) # # Example: %ReportFile=E:\ReportFile.csv # #--------------------------------------------------------------------------------------------------# # Argument call: # # If you need to run the Script with dynamic Values, you can do so, by calling it with arguments. # # Even the Special and Optional Parameters are available in this case. # # Example: # # This Function is currently not implement! # #################################################################################################### Profile = CSVImport ; %CellValue% ; D:\ScriptFiles\Import-FileContentToDB\*.csv ; 4 ; 999999999 ; \^\,\^|\^ ; E:\archiv ; E:\error #Profile = ExcelImport ; %CellValue% ; D:\ScriptFiles\Import-FileContentToDB\Stammdaten.xlsx ; 4 ; 999999999 ; \^\,\^|\^ ; E:\archiv ; E:\error CheckSQL = SELECT 'true' InitialSQL = PreparingSQL = DELETE FROM [DD_ECM].[dbo].[TBCUST_XAP_KUNDENSTAMM_TEST] MainLoopSQL = INSERT INTO [DD_ECM_ZLS].[dbo].[TBCUST_XAP_DOC_EXPORT]([XAP_Beleg_ID],[XAP_Kunden_ID],[XAP_Kundenname],[XAP_Objekt_ID],[XAP_Objektbezeichnung],[XAP_Belegdatum],[XAP_Formular_ID],[XAP_Exportpfad],[ADDED_WHO],[ADDED_WHEN]) SELECT '%column1%','%column2%','%column3%','%column4%','%column5%','%column6%','%column7%','%column8%','DD',getdate() FinalSQL = #Example: #Profile = CSVImport ; %ColumnName%|%CellValue% ; P:\Skriptentwickung\development\Import-CSV2DB\test-dateien\AltesFormat\*.txt ; 1 ; 2 ; . ;%SourceFilePath%\Archiv\%Timestamp5% ; %SourceFilePath%\Error #Profile = CheckSQLQuery = SELECT 'true' #Profile = InitialSQLQuery = SELECT (SELECT [u003] FROM [CWLDATEN].[dbo].[t693] WHERE [u000] = 1)+1 #Profile = PreparingSQLQuery = INSERT INTO [CWLDATEN].[dbo].[TBDD_BATCHIMPORT_HEAD] (BELEGKEY, Konto, Laufnummer, Auftragsnummer) VALUES (%InitialSQLResult%, '700131', NULL, NULL) UPDATE [CWLDATEN].[dbo].[t693] SET u003 = %InitialSQLResult% WHERE [u000] = 1 #Profile = MainLoopSQLQuery = INSERT INTO [CWLDATEN].[dbo].[t699] (u000, u001, u002, u003, u004, u005, u006, u007, u008, u009, u010, u011, u012, u013, u014, u015, u016, u029, u030) Select ISNULL(MAX(u000),0) + 1, %InitialSQLResult%, '%sourcefile%', '%column3%', '%column1%', '%column2%', '%column3%', '%column4%', '%column5%', '%column6%', '%column7%', '%column8%', '%column9%', '%column10%', '%column11%', '%column12%', '%column13%', getdate(), '%username%' FROM [CWLDATEN].[dbo].[t699] #Profile = FinalSQLQuery =