Kategorie: SQL-Server

Problemstellung: Daten sollen mittels “Invoke-SqlCmd” aus einer SQL-Server Datenbanke geholt werden. Sofern das “SqlServer”-Modul für die Powershell installiert ist, kann das auf bequeme Weise mit dem Commandlet “Invoke-SqlCmd” erfolgen. Beispielsweise so: Wie aus dem Code-Block ersichtlich, werden die Ergebnisdaten in der Variable “$result” gespeichert. Wenn man sich die Variable nun ausgeben lässt, dann könnte man […]

Weiterlesen

In order to check the speed of the disk storage connected to my SQL Server at defined intervals, I wrote a powershell wrapper for diskspd. If diskspd is not yet installed on the server to be checked, it will be downloaded from github and copied there. You can then persist the result in a database. […]

Weiterlesen

“Format strings” are used in the measures and other objects so that a predefined representation can be enforced for certain values. Problem: By default, in many languages ​​the “thousands” digit is shown with a “” (space). If another thousands separator is to be used, this can be achieved as described below. So that Analysis Services […]

Weiterlesen

Doing a “SELECT COUNT(*) FROM [TableName]” can be a long running task.Thanks to William Durkin for his example on Twitter to count the rows of a table using the system table “sys.partitions”. To use it in my daily busines, I have wrapped this up in an T-SQL inline function, like this one: This will return […]

Weiterlesen