Skip to content

Instantly share code, notes, and snippets.

View airtank20's full-sized avatar
💭
And the monkey flips the switch...

John Morehouse airtank20

💭
And the monkey flips the switch...
View GitHub Profile
@airtank20
airtank20 / PoSH_Postback.ps1
Created January 7, 2018 20:09
Script to download file from javascript Postback
#URL that needs to be fetched
$url = "https://site.state.gov/default.aspx"
#get the server name in case the process jumps to another script
$serverName = $env:computername
#wrapped it into a try/catch for some type of error handling
TRY {
#use invoke-webrequest to fetch a session from the site
Invoke-WebRequest $url -SessionVariable session -UseBasicParsing
@airtank20
airtank20 / Backup Restore With Move Commands.sql
Created January 18, 2018 02:10
TSQL script that will provide a backup & restore command
DECLARE @date CHAR(8)
SET @date = (SELECT CONVERT(char(8), GETDATE(), 112))
DECLARE @path VARCHAR(125)
SET @path = '\\UNCPath\Folder\'
;WITH MoveCmdCTE ( DatabaseName, MoveCmd )
          AS ( SELECT DISTINCT
                        DB_NAME(database_id) ,

The Award for the Two Best SQL Server 2019 Features Goes to…

SQL Server 2019, in my opinion, is one of the greatest releases that has arisen from Microsoft in the last decade. It comes with a multitude of enhancements across the board in the data platform ecosystem. However, there are two features that significantly impact the day to day lives of data professionals everywhere, namely Accelerated Database Recovery (ADR) and Resumable Index Creation. How impressive would it be to have a rollback operation complete in seconds where previously it would be hours or days? Would you like to have the ability to manage how you create that index on your multi-billion row table? Now you can! In this session we will examine in detail these two new features and demonstrate how they can help to accomplish both of those goals and improve your life when dealing with rollbacks and managing index operations. The days of horror stories around these two activities are a thing of the past thanks to SQL Server 2019.

Indexes: The Voodoo of SQL Server

Microsoft SQL Server is a large data ecosystem with many facets that can affect how your queries perform. Facets like what kind of hardware are you using, how much memory, CPUs. Many of these facets cost money and there are many things about them that can be turned on, tweaked, or implemented to help improve performance. Did you know that you can implement a low-cost solution of proper indexing? Proper indexes can help not only improve query performance but also help save money on hardware! In this session, we'll examine the foundation of how indexes work, what the moving parts are and why they are important. We'll examine some real-world examples of where queries were falling short but then were successful with proper indexing. You'll walk away with techniques on how to know where and how to add indexes to help you start to save money!

Improving Performance with Intelligent Query Processing

One of the core pillars in the role of a database administrator is to ensure their systems run as efficiently as possible. We don't sit around and want a SQL Server to run slower, so we implement steps to ensure our SQL servers perform at maximum capacity. Rebranded from SQL Server 2017 Adaptive Query Processing (AQP) to  Intelligent Query Processing (IQP) with, Microsoft continues to bring forth enhancements in making the query optimizer a learning machine to help intelligently improve performance. Walking away after this session, you'll have a better understanding on how IQP features, such as scalar user defined function improvements, table variable deferred compilation, or adaptive joins, will help ensure your SQL Servers run at optimal performance.

SQL Server Performance Tuning for Beginners

We've all had to start somewhere in our current career path. My own adventure started what feels like eons ago when I became an accidental DBA overnight and I had absolutely zero clue on how to performance tune our SQL Servers. I was stuck and wasn't quite sure where to turn. Things had to perform better but no idea where to start. Does this sound familiar? Ringing any bells? If so, this session is for you! We'll start at the ground floor and talk about the basics of how-to performance tune your SQL servers so that they run at peak performance! We'll look at configuration settings, database options, trace flags, query tuning and a few tools that can help you squeeze every ounce of performance out of SQL Server! By the end of this session, you'll walk away with a good solid understanding of how to start performance tuning. You will take away some scripts and tool suggestions that will enable you to hit the ground running back at the office!

Data Migration to Azure Made Easy

When you decided to move to any cloud provider, the thought about how to migrate all your data can seem like a daunting task. Thankfully, it isn't as daunting as you might think thanks to some native tools as well as tools offered by Microsoft. In this session we'll examine these methods and tools that will help you to migrate your data to Azure in a safe, secure, cost effective and successful manner. We will also look how these migrations work when working with three of the Azure data platform products, namely virtual machines, SQL DB, and Managed Instances. By the end of this session you will have gained newfound confidence to help you get your data up into the cloud!

Optimizing Query Performance in Azure SQL Database

Many think that moving to the cloud will not only help brighten your teeth but also solve all your bad coding practices that give you poorly performing queries. If it's done correctly, implementing Azure SQL Database can help with one of those two and while it can mask things well, the best solution is to fix the bad code. In this hour-long session, we'll examine several different methods that you can utilize to help fix bad query performance starting with the underlying service tier. Next, we'll investigate what options are available directly from the Azure portal to determine where the bottlenecks might reside along with possible ways to fix them. Lastly, we will interrogate which native SQL Server tools exist within Azure SQL Database that can really help solve performance issues you might be having. You'll leave this session with a solid understanding of how to trouble shoot performance issues in Azure SQL Database and what you might be able to

Many think that moving to the cloud will not only help brighten your teeth but also solve all your bad coding practices that give you poorly performing queries. If it's done correctly, implementing Azure SQL Database can help with one of those two and while it can mask things well, the best solution is to fix the bad code. In this hour-long session, we'll examine several different methods that you can utilize to help fix bad query performance starting with the underlying service tier. Next, we'll investigate what options are available directly from the Azure portal to determine where the bottlenecks might reside along with possible ways to fix them. Lastly, we will interrogate which native SQL Server tools exist within Azure SQL Database that can really help solve performance issues you might be having. You'll leave this session with a solid understanding of how to trouble shoot performance issues in Azure SQL Database and what you might be able to do to help fix them.
@airtank20
airtank20 / GenerateSQLSaturdaySpeakerTweets.ps1
Created July 3, 2018 13:49
Generate SQL Saturday Speaker Tweeks
##########################################################################################
#- Author: John Morehouse
# Date: August 2015
# T: @SQLRUS
# E: john@jmorehouse.com
# B: http://sqlrus.com
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY
# AND/OR FITNESS FOR A PARTICULAR PURPOSE.
#