This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @ReferenzDatum AS DATE = '31.01.2023'; | |
DECLARE @Datum AS DATE = @ReferenzDatum; | |
DECLARE @i AS INT = 0; | |
IF OBJECT_ID('tempdb.dbo.#Datumsbereich', 'U') IS NOT NULL | |
DROP TABLE #Datumsbereich; | |
CREATE TABLE #Datumsbereich( | |
DatumZahlung Date, | |
Datum Date, | |
DifferenzMonate int | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Position 1 aus Beleg 2003-30001 1 aus Max Mustermann Datenbank | |
DECLARE @BelPosId INT = 89; | |
DECLARE @Mandant SMALLINT = 123; | |
WITH Etikett AS | |
( | |
-- Hier setze ich ein beliebiges numerisches Feld als Counter. | |
-- Du kannst an dieser Stelle die Anzahl der Etiketten berechnen. | |
SELECT TOP (SELECT CONVERT(INT,Menge) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetCurrentWeek() { | |
let date = new Date(); | |
let currentThursday = new Date(date.getTime() + (3 - ((date.getDay() + 6) % 7)) * 86400000); | |
let yearOfThursday = currentThursday.getFullYear(); | |
let firstThursday = new Date(new Date(yearOfThursday, 0, 4).getTime() + (3 - ((new Date(yearOfThursday, 0, 4).getDay() + 6) % 7)) * 86400000); | |
let weekNumber = Math.floor(1 + 0.5 + (currentThursday.getTime() - firstThursday.getTime()) / 86400000 / 7); | |
return weekNumber; | |
} | |
function donnerstag(datum) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @BelId AS INT = 4017 | |
DECLARE @Mandant AS SMALLINT = 123 | |
-- geparkte/nicht gespeicherte Belege | |
SELECT | |
TOP 1 | |
POS.ProjektID | |
,PRO.Projektnummer | |
FROM tBSCrmBelege AS TB | |
INNER JOIN tBSCrmBelegreferenzen AS TBR ON TB.ID = TBR.FK_BelegID AND TB.Mandant = TBR.Mandant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @name VARCHAR(50) -- Name der Datenbank | |
DECLARE @path VARCHAR(256) -- Dateiablagepfad der Backups | |
DECLARE @fileName VARCHAR(256) -- Dateiname des Backups | |
DECLARE @fileDate VARCHAR(20) -- Datum/Uhrzeit im Dateinamen | |
-- Pfad des Backupordners setzen | |
SET @path = 'C:\Backup\' | |
-- Datum in Datei | |
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ContextReportBeforeRender(IDcmContext context) | |
{ | |
var reportContextAfterRender = (DcmContextReportBeforeRender)context; | |
var parameters = (NamedParameters)reportContextAfterRender.Parameters; | |
if (!ConversionHelper.ToBoolean(parameters.TryGetItem("rpKopieText").Value)) | |
{ | |
var report = (StiReport)reportContextAfterRender.Report; | |
var lblKopie = (StiText)report.Pages[0].GetComponents().ToList().FirstOrDefault(x => x.Name == "lblKopie"); | |
if (lblKopie != null) | |
lblKopie.Enabled = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Description: | |
# Update the DNS A Record with your public IP address for the one.com host. | |
# | |
# Recommendation: | |
# - Create a separate user that can only access the DNS records. | |
# - Create a cron tab to run this script every 30 minutes: | |
# crontab -e | |
# */30 * * * * ~/Scripts/update-dns-one.com.sh >/dev/null 2&>1 | |
# - To get the Sub Domain Id you will have to manually update the domain and record the network traffic using your browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT c.name AS 'ColumnName', t.name AS 'TableName' | |
FROM sys.columns c | |
INNER JOIN sys.tables t ON c.object_id = t.object_id | |
WHERE c.name = 'Adresse' | |
ORDER BY TableName, ColumnName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ShortId | |
{ | |
public static readonly string Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
private static string ReverseString(this string value) | |
{ | |
char[] arr = value.ToCharArray(); | |
Array.Reverse(arr); | |
return new string(arr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if which features might already be enabled | |
Get-WindowsOptionalFeature -Online -FeatureName *hyper-v* | select DisplayName, FeatureName | |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All | |
NewerOlder