Skip to posts
  • Publications
  • Code Library
  • Events
  • Presentations
  • Who Am I?
  • Copyright

Wayne Sheffield

My blog about SQL Server
  • Home
  • Publications
  • Code Library
  • Events
  • Presentations
  • Who Am I?
  • Copyright
  • Latest Posts
  • Latest Comments


MCM


MVP

(2017-2022)

Top 50 SQL blog 2018

Recent Posts

  • Availability Group issues fixed with Alerts
  • Using Google Chrome with SSRS
  • Speakers wanted for the Richmond (VA) SQL Server Users Group – 2020
  • T-SQL Tuesday #120 – Recap
  • T-SQL Tuesday #120 – What were you thinking? – Invitation

Top Posts

  • Using a gMSA with SQL Server
  • A Page Split in SQL Server - the Good, the Nasty and the Smart
  • SSMS: Batch Separator (Day 35)
  • Identifying a row's physical location

Archives

Categories

Tags

2020 absolute values (ABS()) Advanced Certifications analytic functions assign sequential number automation Availability Group Back To Basics case-sensitive CLR String Security clustered index common table expression Data Movement deadlock analysis Denali Double-Hop efficiency extracting data from strings Failover Functions Google Chrome import file index analysis myth order by Performance physical tally table Quirky Update Scalar UDF Inlining split string splitting strings SQL SQL 2019 SQL Server SSMS SSMS Tips SSRS String Splitter T-SQL Tuesday tally table Trusted Assembly TSQL Tuesday virtual tally table Why do you do what you do? wrapup

Blogroll

  • Dave Ballantyne
  • Adam Machanic
  • Andy Leonard
  • Paul White
  • Robert Pearl
  • Tim Ford
  • Jason Brimhall
  • Rob Farley
  • Benjamin Nevarez
  • Louis Davidson
  • Kalen Delaney
  • Grant Fritchey
  • Jonathan Kehayias
  • Lynn Pettis
  • Brent Ozar
W3Counter Web Stats

Get-SQLSaturdaySessionTopicSearch

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<#
.SYNOPSIS
Powershell script to see if there are if there are any SQL Saturday sessions that are about a specified phrase.
 
.DESCRIPTION
This script will search the SQL Saturday sessions, looking in both the session title and description, for the specified phrase.
The search stops after being unable to load 10 events.
 
Screen Output:
Event Number, Speaker, Session Title, Session URL
 
Optional parameters allow you to control which SQL Saturday event number to start looking at, and the starting and ending date to look through.
 
The optional parameter $ExportFile allows you to export this information to a comma-separated file.
When this is used, the event name and event description are also included in the export, and the URL inside the excel "HYPERLINK" function,
allowing you to open the file with Excel and just click the link to see the session information.
 
.PARAMETER $SearchTopic
The topic that you want to search. Required entry.
.PARAMETER $StartDate
The first event date that you want to search the events. Default: 30 days prior to today.
.PARAMETER $EndDate
The last event date that you want to search the events. Default: 30 days after today.
.PARAMETER $EventNumber
The first event number that you want to check for matching dates. Default: 500
.PARAMETER $ExportFile
Where you want to send a csv export file to. Default: empty string (export file not created)
.PARAMETER $DebugLevel
Control debug output messages while script is running. Default: 1
   Values:
    1: Display SQL Saturday URL as that SQL Saturday is processed.
    2. Also display event name / date if that URL could be opened.
    3. Also display session title for matched sessions.
    4. Also display all session titles.
 
.EXAMPLE
.\Get-SQLSaturdaySessionTopicSearch.ps1 -SearchTopic 'Query Store'
.EXAMPLE
.\Get-SQLSaturdaySessionTopicSearch.ps1 -SearchTopic 'Query Store' -ExportFile 'C:\Temp\SQLSatSearchResults.csv'
 
.NOTES  
Author: Wayne Sheffield
Script Home Page: //blog.waynesheffield.com/wayne/get-sqlsaturdaysessiontopicsearch
 
Initial idea for how to load this data is from Steve Jones' blog post at //voiceofthedba.wordpress.com/2015/01/26/downloading-sql-saturday-data/.
 
*******************************************************************************
                               MODIFICATION LOG
*******************************************************************************
2016-06-24 WGS Initial Creation.
*******************************************************************************
#>
 
Param
(
    [Parameter(Mandatory=$true)]
    [string]$SearchTopic = '',
    [datetime]$StartDate = (Get-Date -Hour 0 -Minute 0 -Second 0).AddDays(-30),
    [datetime]$EndDate = (Get-Date -Hour 0 -Minute 0 -Second 0).AddDays(30),
    [int]$EventNumber = 500,
    [string]$ExportFile = '',
    [int]$DebugLevel = 1
)
 
cls;
 
$baseUrl = "//www.sqlsaturday.com/eventxml.aspx?sat=";
$Failed = 0;
$EventList = @();
$MyEventSpeakers = New-Object System.Collections.ArrayList
$doc = New-Object System.Xml.XmlDocument;
 
$sourceURL = $BaseURL + $EventNumber;
$doc.Load($sourceURL);
$guide = $doc.SelectNodes("GuidebookXML/guide");
$EventDate = $guide.startDate;
 
# add wildcards
$SearchTopic = "*" + $SearchTopic + "*";
 
while ($EventNumber -lt 9999) {
    $sourceURL = $baseUrl + $EventNumber;
    if ($DebugLevel -ge 1) {
        Write-Host "Source URL: $sourceURL";
    } # debug messages at level 1
 
    try {
        $doc.Load($sourceURL);
        $event = $doc.SelectNodes("GuidebookXML/guide");
        $EventName = $event.name;
        [datetime]$EventDate = $event.startDate;
        
        if ($DebugLevel -ge 2) {
            Write-Host $EventName $EventDate
        } # debug messages at level 2
        if ($EventDate -ge $StartDate -and $EventDate -le $EndDate) {
            $sessions = $doc.SelectNodes("GuidebookXML/events/event")
            foreach ($session in $sessions) {
                if ($DebugLevel -ge 4) {
                    Write-Host $session.title
                } # debug messages at level 4
                if ($session.title -like $SearchTopic -or $session.description -like $SearchTopic) {
                    if ($DebugLevel -ge 3) {
                        Write-Host "Found a match: " + $session.title;
                    } #message
                    $Event = New-Object System.Object;
                    $Event | Add-Member -type NoteProperty -Name Event -Value $EventNumber;
                    $Event | Add-member -type NoteProperty -Name EventName -Value $EventName;
                    $Event | Add-Member -type NoteProperty -Name Speaker -Value $session.speakers.speaker.name;
                    $Event | Add-Member -type NoteProperty -Name Session -Value $session.title;
                    $Event | Add-Member -type NoteProperty -Name Abstract -Value $session.description;
                    $url = "//www.sqlsaturday.com/$EventNumber/Sessions/Details.aspx?sid=" + $session.importID;
                    $Event | Add-Member -type NoteProperty -Name Url -Value $url;
                    $EventList += $Event;
                } #if session has phrase
            } #foreach session
        } #if event in date range
    } #try
    
    catch {
        $Failed = $Failed + 1;
        if ($Failed -eq 10) {
            $EventNumber = 9999
        } #if failed
    } #catch
    $EventNumber += 1;
} #while
 
#Show results if any
if ($EventList.Count -gt 0) {
    $EventList | Sort-Object Event, Session | Format-Table -Autosize -Wrap -Property Event,Speaker,Session,Url;
}
 
#Export to csv if filename specified
if ($ExportFile -gt '') {
    ForEach ($Event in $EventList) {
        $Event.Url = '=HYPERLINK("' + $Event.Url + '")'
    }
    $EventList | Sort-Object Event, Session | Export-csv $ExportFile -NoTypeInformation;
}

 

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print
  • More
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Reddit (Opens in new window) Reddit

Like this:

Like Loading...
Powered by WordPress Web Design by SRS Solutions © 2025 Wayne Sheffield Design by SRS Solutions
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}
%d