meine Sys/Db admin & Developper Notitzen - wer Rechtschreibfehler findet darf sie behalten ... my Sys/Db Admin and developper notes - I don't care about typos
Tuesday, October 28, 2014
sql server tables unused space / unbenutzer Platz in Sql Server Tabellen, filesize / filegröße
--sql server tables unused space / unbenutzer Platz in Sql Server Tabellen:
SELECT
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 AS TotalSpaceKB,
SUM(a.used_pages) * 8 AS UsedSpaceKB,
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB
FROM sys.tables t
INNER JOIN sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN sys.allocation_units a ON p.partition_id = a.container_id
LEFT OUTER JOIN sys.schemas s ON t.schema_id = s.schema_id
WHERE t.NAME NOT LIKE 'dt%' AND t.is_ms_shipped = 0 AND i.OBJECT_ID > 255
GROUP BY t.Name, s.Name, p.Rows
ORDER BY UnusedSpaceKB desc
--filegröße / filesize
SELECT DB_NAME(database_id) AS DatabaseName,
Name AS Logical_Name,
Physical_Name, (size*8)/1024 SizeMB
FROM sys.master_files
where right(physical_name,3)='mdf'
order by size desc
Thursday, August 28, 2014
bootrec (windows 10)
bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd
wichtig: bios bootdevice muß harddisk sein => boot von hd einstellen und bootmenu aufrufen um dann von install disk zu booten, dann obige commandos ausführen win server braucht keine extra partition bcdboot c:\windows /s c: ... kopiert boot files von c:\windows\Boot auf C:\Boot wenn HyperV nicht automatisch startet: bcdedit /set hypervisorlaunchtype Auto
bootrec /fixboot
bootrec /rebuildbcd
wichtig: bios bootdevice muß harddisk sein => boot von hd einstellen und bootmenu aufrufen um dann von install disk zu booten, dann obige commandos ausführen win server braucht keine extra partition bcdboot c:\windows /s c: ... kopiert boot files von c:\windows\Boot auf C:\Boot wenn HyperV nicht automatisch startet: bcdedit /set hypervisorlaunchtype Auto
Wednesday, August 27, 2014
windows server 2012 Disk management
Server Manager unterstützt scheinbar keine MBR Initialisation, daher:
power shell: Initialize-Disk 4 –PartitionStyle MBR
Thursday, August 21, 2014
TSQL if then
--simplest / einfach
if 1=1 Print 'Ja-Yes' else print 'nein-no'
--one begin End block
if 1=0
Begin
Print 'Ja-Yes'
End
else print 'nein-no'
--two ifs
if 1=0
Begin
Print '1:Ja-Yes'
End
else if 1=1 print '1:nein-no, 2:ja-yes' else print '1:nein-no, 2:nein-no'
Friday, August 08, 2014
vs2008 ssrs: Filter in "test1,test2,test3" not working in preview
the in clause is not working in preview, but on reportserver: I have a sharepoint datasource, and a dataset, which I filter in a table with th IN clause - doesn't display any matches, but when I deploy it is working
Sunday, August 03, 2014
einfache / simple cte (common table expression)
with cte as (
select Year(GETDATE())*10000+MONTH(GetDate())*100+DAY(GetDate()) as intDate
)
select * from cte
Friday, August 01, 2014
ssrs display subreport without data / Unterbericht ohne Daten anzeigen
ein Unterbericht ohne Daten wird nicht angezeigt (wenn alle Datasets in diesem Report keine Zeilen haben, wird allerdings als eigenständiger Bericht angezeigt) => um ihn dennoch anzeigen einfach ein Dummy Dataset mit select 'dummy' as dummy einfügen, das hat immer eine Zeile und damit wird der Subreport angezeigt.
a subreport with all datasets having 0 rows isn't displayed (although as normal report is displayed) => add a dummy dataset which always returns a row to display (e.g. select 'dummy' as dummy )
ssrs gauge aggregate function report item
error / fehler:
The value expression for the gauge panel 'GaugePanel1' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers.
solution / lösung: change Indicator Properties / Values and States / States Measurement Unit from percentage to numeric
in Indicator Properties / Values and States / States Measurement Unit von Prozent auf numerisch ändern
The value expression for the gauge panel 'GaugePanel1' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers.
solution / lösung: change Indicator Properties / Values and States / States Measurement Unit from percentage to numeric
in Indicator Properties / Values and States / States Measurement Unit von Prozent auf numerisch ändern
Thursday, July 24, 2014
ssrs: vs2008 vorschau fehler / visual stuido 2008 preview error
sometimes gauge panels with 3 traffic light indicators shows in visual stuidio 2008 preview all three lights on, although it should only show one - when deploying, and showing same data, only one traffic light of three is on, as it should be ...
manchmal werden bei einem Gauge Panel mit 3 Ampel Indikatoren in der Visual Studio Vorschau alle 3 Ampellichter zugleich angezeigt - obowhl immer nur eines "leuchten" sollte. Wenn derselbe Report deployed wird und mit denselben Daten aufgerufen wird, wird korrekt nur ein Ampellicht (rot/grün/gelb) angezeigt ...
ssrs Tabelle mit nur Gruppierungszeilen ohne Details
eine neue Tabelle hat standardmäßig nur eine Zeile, die der Detailsgruppe "Detail1" zugeordnet ist. Geht man nun auf die Eigenschaften von "Details1" und fügt eine Gruppierung hinzu, verschwinden die waagrechten Detailszeilenzeichen und eine reine Gruppierungszeile entsteht (
sql server reporting services ssrs: transformation scope for state indicator must be specified
see property page of indicater scope property: e.g.: Scope=tablix1
ssrs not showing table
some grouping trouble can lead to not showing table at all - solution: delete group or check it
Monday, June 30, 2014
SSRS 2008 Dataset Filter
SSRS 2008 Dataset Filter can't include following expressions / können folgende Expressions nicht verwenden:
Aggregatsfunktionen (=First(...))
ReportItems
hypervisor not running: bcdedit /set hypervisorlaunchtype Auto
bcdedit /set hypervisorlaunchtype Auto
Tuesday, June 24, 2014
Reporting Services: getting values of textboxes with reportitems - werte aus Textboxen auslesen mittels ReportItems: =ReportItems!textbox3.Value
z.b. / eg.:
=ReportItems!textbox3.Value
ssrs 2008 shared sharepoint datasource doesn't work
using internal ssrs 2008 shared sharepoint datasource: no problem generating dataset
using same shared datasource, doesnt work
Wednesday, June 04, 2014
sql server: Check Constraints ein / ausschalten - switch on / off (z.b. Foreign Keys)
alter table tablename nocheck constraint all
alter table tablename check constraint all
Tuesday, June 03, 2014
Friday, May 30, 2014
Expression Textbox SSRS 2008 (Sql Server Reporting Services)
wenn bei einer TextBox in SSRS 2008 (Sql Server Reporting Services) mit rechter Maustaste im Context Menü "Expression" ausgegraut ist und auch nicht in TextBoxProperties General kein Value vorhanden ist, kann man durch Eingabe von z.b. ="X" in die Textbox direkt im Designer den Menüpunkt Expression bzw. die Value Eigenschaft wieder aktivieren.
OU (Organisation Unit) of ACtive Directory User
In Active Directory Users and COmputers: Menu View / Advanced Features
=> USer Prperties Show Tab Object, There you finde the Canonical Name of object
Subscribe to:
Posts (Atom)