View gist:77eca81a1ab4e0f51dea
1 2 3 4 5 6 7 8 9 10
# Load Assembly
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") >$NULL
# Connect to Tabular SSAS
$srv = New-Object Microsoft.AnalysisServices.Server
$srv.connect("localhost")
# Point to a specific Database
$db = $srv.Databases.FindByName("MyDatabase");
View add-new-tabular-partition
1 2 3 4 5 6 7 8 9
# Load Assembly
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") >$NULL
 
# Connect to Tabular SSAS
$srv = New-Object Microsoft.AnalysisServices.Server
$srv.connect("localhost\TABULAR")
 
# Point to a specific Database
$db = $srv.Databases.FindByName("DatabaseName");
View get-wait-stats
1 2 3 4 5 6 7 8 9 10
if (object_id('tempdb..#t1') is not null) drop table #1
if (object_id('tempdb..#t2') is not null) drop table #2
go
 
select sample_date = sysdatetime(), * into #t1 from sys.dm_os_wait_stats
waitfor delay '00:00:01'
select sample_date = sysdatetime(), * into #t2 from sys.dm_os_wait_stats
go
 
select top 25
View get-sql-table-size
1 2 3 4 5 6 7 8 9 10
DECLARE @tableNamePattern SYSNAME = '%'
 
SELECT
t.name,
p.index_id,
p.partition_number,
[rows] = format(p.row_count, '#,0'),
used_space = format(p.used_page_count * 8 / 1024., '#,0 MB'),
reserved_space = format(p.reserved_page_count * 8 / 1024., '#,0 MB')
FROM
View get-ssas-server-info
1 2 3 4 5 6 7
[Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") | Out-Null
 
$serverName = "localhost"
$server = New-Object Microsoft.AnalysisServices.Server
$server.Connect($serverName)
 
Write-Output ("`nServer: {0}`nEdition: {1}`nBuild: {2}" -f $server.Name, $server.Edition, $server.Version)
View get-sql-supported-collations
1 2 3 4 5 6 7 8 9
SELECT
[name]
, [CodePage] = COLLATIONPROPERTY([name], 'CodePage')
, [LCID] = COLLATIONPROPERTY([name], 'LCID')
, [ComparisonStyle] = COLLATIONPROPERTY([name], 'ComparisonStyle')
, [Version] = COLLATIONPROPERTY([name], 'Version')
, [description]
FROM
::fn_helpcollations();
Something went wrong with that request. Please try again.