Category Archives: SQL Server

ConfigMgr Package Status Reports

Found a nice idea for a report on Eswar Koneti’s blog. That query combined with some info from a blogpost by Jörgen Nilsson will give you two reports to dig into status of packages. Status of Distribution Points with Package … Continue reading

Posted in ConfigMgr, SQL Server | Comments Off on ConfigMgr Package Status Reports

Update ConfigMgr packages with Hotfix-information

When you install a hotfix and/or a cumulative update in ConfigMgr you can select the option to let the installer create some packages. But, those packages are missing some info… For instance Manufacturer and Version. A quick and dirty SQL … Continue reading

Posted in ConfigMgr, SQL Server | Tagged , , , | Comments Off on Update ConfigMgr packages with Hotfix-information

SQL in Powershell without cmdlets

I am currently playing around with ConfigMgr 2012 cmdlets… and they only run in X86 (*doh*). Anyway, I need to query a database with information about some collections and other stuff I need to create… and running SQL Server cmdlets … Continue reading

Posted in PowerShell, SQL Server | Tagged , , , | Comments Off on SQL in Powershell without cmdlets

Update ConfigMgr Site Description

I did an install of a secondary site and accidently put in the wrong description… Anyway, easy to fix with some SQL commands. If you use this you can see the current sitenames and descriptions (change CM_XYZ to your database … Continue reading

Posted in ConfigMgr, SQL Server | Tagged , , | 1 Comment

List MOM2005 agents with IP-adress

A small SQL-script to list all agents on a MOM2005 installation.

Posted in MOM2005, SQL Server | Tagged | Comments Off on List MOM2005 agents with IP-adress

Backup av SQL-databaser

Att ta backup på SQL-databaser & loggar är lite lagomt tråkigt. Gör man det med maintenance-plan’s så får man en miljard (nåja… ett ganska rejält gäng iaf) filer. Kör man det genom någon annan wizard så blir det måttligt bra. … Continue reading

Posted in SQL Server | Tagged | Comments Off on Backup av SQL-databaser

SQL-Script: logTrunkering

Ett litet SQL-script som trunkerar överväxta log-filer. Script: logTrunkering.sql

Posted in SQL Server | Tagged , , | Comments Off on SQL-Script: logTrunkering

Bygga om index i en SQL-DB

Så här bygger man om alla index i en SQL-databas. DECLARE @TableName varchar(255) DECLARE TableCursor CURSOR FOR SELECT table_name FROM information_schema.TABLES WHERE table_type = ‘base table’ OPEN TableCursor FETCH NEXT FROM TableCursor INTO @TableName WHILE @@FETCH_STATUS = 0 BEGIN DBCC … Continue reading

Posted in SQL Server | Tagged , | Comments Off on Bygga om index i en SQL-DB

Uppdatera GroomDays i SCDW

För att minska ner storleken på SystemCenterReporting-databasen kan man dra ner på antalet dagar man sparar data. Genom att köra det här SQL-scriptet så drar man ner till 7 dagar. USE SystemCenterReporting Declare @Groomdays int Select @Groomdays=7 exec p_updateGroomDays ‘SC_SampledNumericDataFact_Table’, … Continue reading

Posted in MOM2005, SQL Server | Tagged , , | Comments Off on Uppdatera GroomDays i SCDW

Backup/Restore av SQL-databas

Jag har nog svarat femtielva gånger på varför användarna inte följer med när man flyttar en SQL-databas från en server till en annan Så här är det. – Användarna finns i databasen MSDB – Rättigheterna finns i den “vanliga” databasen … Continue reading

Posted in SQL Server | Tagged , , | 2 Comments