Skip to content

Commit 282d737

Browse files
authored
Merge pull request #401 from shueybubbles/ssmsTemplates
Ssms templates - initial checkin
2 parents 356da36 + 7e02cfb commit 282d737

446 files changed

Lines changed: 7994 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Basic DAX Query */
2+
3+
EVALUATE <>
4+
ORDER BY <> <ASC or DESC>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// ==========================
2+
// Content Query
3+
// ==========================
4+
5+
SELECT <select list,expr list,*> FROM [<mining model,name,MyModel>].CONTENT
6+
WHERE <where clause,boolean expression,>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// ==========================
2+
// Continuous Column Values
3+
//
4+
// Returns the min, max, and
5+
// mean of a continuous column,
6+
// or of the buckets of a
7+
// DISCRETIZED column
8+
// ==========================
9+
10+
SELECT DISTINCT
11+
RangeMin([<column,name,MyColumn>]) as [Min],
12+
[<column,name,MyColumn>] as [Mean],
13+
RangeMax([<column,name,MyColumn>]) as [Max]
14+
FROM [<mining model,name,MyModel>]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// ==========================
2+
// Discrete Column Values
3+
//
4+
// Returns all values of a
5+
// DISCRETE column. For
6+
// DISCRETIZED columns, use
7+
// the Continuous Column
8+
// Values template.
9+
// ==========================
10+
11+
SELECT DISTINCT [<column,name,MyColumn>]
12+
FROM [<mining model,name,MyModel>]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// ==========================
2+
// Drillthrough Query
3+
// ==========================
4+
5+
SELECT <select list,expr list,*>
6+
FROM MINING MODEL [<mining model,name,MyModel>].CASES
7+
WHERE IsTrainingCase() AND IsInNode('<node id,name,>')
8+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// ==========================
2+
// Model Attributes
3+
//
4+
// returns the list of attributes
5+
// used by a model
6+
// ==========================
7+
8+
CALL System.GetModelAttributes('<mining model, name, MyModel>')
9+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// ==========================
2+
// PMML Content
3+
// ==========================
4+
5+
SELECT * FROM [<mining model,name,MyModel].PMML
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// ============================
2+
// Add Model
3+
// ============================
4+
5+
ALTER MINING STRUCTURE [<mining structure,name,MyStructure>]
6+
ADD MINING MODEL [<mining model,name,MyModel>]
7+
(
8+
[<key column, col def, ID>],
9+
<column definition list,col def list,>,
10+
<table column definition,col def,[My Table]>
11+
( [<nested key column, col def, Nested Key>],
12+
<nested columns,col def list,> ) [WITH FILTER (<filter>)]
13+
) USING <algorithm,name,Microsoft_Decision_Trees>( <parameters,param list,> )
14+
[WITH [DRILLTHROUGH] [[,] FILTER (<filter>)]]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// ===============================
2+
// Clear Model Content
3+
// ===============================
4+
5+
DELETE FROM MINING MODEL [<mining model,name,MyModel>]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// ===============================
2+
// Clear Mining Structure
3+
// ===============================
4+
5+
DELETE FROM MINING STRUCTURE [<mining structure,name,MyStructure>]

0 commit comments

Comments
 (0)