Home
Videos uploaded by user “Bert Wagner”
How to Use Temporal Tables in SQL Server 2016
 
10:18
Have you ever needed to look at what data in a table used to look like? If you have, it probably took a knuckle-cracking filled session of writing group-by statements, nested sub-queries, and window functions to write your time-travelling query. Fortunately for us, SQL Server 2016 introduces a new feature to make our point-in-time analysis queries easy to write: temporal tables. Full blog post: https://bertwagner.com/2017/07/19/how-to-use-sql-temporal-tables-for-easy-point-in-time-analysis/ Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/ Elsewhere on the internet: https://bertwagner.com https://twitter.com/bertwagner
Views: 2887 Bert Wagner
How to Stop Parameter Sniffing in SQL Server
 
09:07
Are your query parameters being sniffed by SQL Server? Learn how to recognize and solve parameter sniffing performance problems in your SQL queries. Links below. Blog post: https://blog.bertwagner.com/why-parameter-sniffing-isnt-always-a-bad-thing-but-usually-is-ba6a62a97b68 Follow me on Twitter: https://twitter.com/bertwagner Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 1695 Bert Wagner
Differences between Clustered vs Nonclustered Indexes in SQL Server
 
11:48
Should you use a clustered or a nonclustered index? When starting out with SQL, you might intuitively know that you should add an index to a table, but you might not be sure what kind of index to add. In this video we go over the basics of clustered and nonclustered indexes to help you get through index choice paralysis. Blog post with example queries: https://bertwagner.com/2017/09/26/clustered-vs-nonclustered-index-fundamentals-you-need-to-know/ Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 4789 Bert Wagner
Pinal Dave's Real World Performance Solutions
 
04:15
Sometimes it's challenging to solve tough SQL Server problems on my own. In those cases, I call up a friend like Pinal Dave for some expert advice and guidance. Thank you Pinal for collaborating on this video - it was a TON of fun to shoot and make. If you are looking to learn some practical real-world performance tuning with Pinal, check out his course: https://www.brentozar.com/go/practical Pinal's blog (this may have been the first SQL Server website I ever visited): https://blog.sqlauthority.com/ Pinal's script for identifying implicit conversions (and a few ways to solve them): https://blog.sqlauthority.com/2018/06/11/sql-server-how-to-fix-convert_implicit-warnings/ Pinal on Twitter: https://twitter.com/pinaldave Bert's behind the scenes blog post on making this video: https://bertwagner.com/2018/07/24/pinal-helps-me-fix-my-performance-tuning-problems/ Bert on Twitter: https://twitter.com/bertwagner
Views: 2788 Bert Wagner
Stealing Data with Second Order SQL Injection
 
04:44
Hackers can't always immediately exploit a SQL injection vulnerability. Sometimes they need to inject query fragments into a database column and wait for a different query to fall prey to their SQL injection attack. In this video we look at what a second order SQL injection attack looks like and how it works. Related blog post: https://bertwagner.com/2018/03/20/how-to-steal-data-using-a-second-order-sql-injection-attack/ Twitter: https://twitter.com/bertwagner Instagram: https://twitter.com/bertwagner Facebook: https://www.facebook.com/SQLWithBert Want to receive my latest weekly blog posts and videos in your inbox? Sign up for my weekly newsletter here: http://eepurl.com/cMkYl1
Views: 998 Bert Wagner
XML vs JSON in SQL Server 2016
 
17:46
Starting with the 2016 release, SQL Server offers native JSON support. We compare JSON versus XML and determine which is better to use in SQL Server. Full blog post: https://bertwagner.com/2017/05/16/xml-vs-json-shootout-which-is-superior-in-sql-server-2016/ Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/ Elsewhere on the internet: https://bertwagner.com https://twitter.com/bertwagner
Views: 4262 Bert Wagner
Performance of SARGable queries in SQL Server
 
04:28
Are your queries SARGable? Do you want to find all non-SARGable queries running on your SQL Server? SARGable, or "Search ARGument-able", queries are those that are able to use indexes to efficiently return result sets. Finding non-SARGable queries on your SQL Server and making them SARGable is one of easiest you can do to improve your server's performance. Links below. Blog post with example queries: https://blog.bertwagner.com/how-to-search-and-destroy-non-sargable-queries-on-your-server-ff9f57c7268e Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 432 Bert Wagner
SQL Server Implicit Conversions Hurt Performance
 
05:07
Ever wonder why your carefully crafted indexes aren't getting used? The problem might be column-side implicit conversions. Links below. Blog post: https://blog.bertwagner.com/are-your-indexes-being-thwarted-by-mismatched-datatypes-d3985375e528 Microsoft's chart of data type conversions: https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-type-conversion-database-engine Jonathan Kehayias's script for finding column side implicit conversions in your plan cache: https://www.sqlskills.com/blogs/jonathan/finding-implicit-column-conversions-in-the-plan-cache/ Follow me on Twitter: https://twitter.com/bertwagner Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 546 Bert Wagner
SQL Server In-Memory OLTP Use Case
 
05:27
SQL Server 2014 introduced in-memory features that have improved with every version since then. This week we go through an example use case of converting a staging ETL to using in-memory tables and natively compiled procedures to get huge performance gains. Related blog post with code snippets: https://bertwagner.com/2018/04/17/in-memory-oltp-a-case-study/ Twitter: https://twitter.com/bertwagner Instagram: https://www.instagram.com/bertwagner/ https://www.instagram.com/codewithbert/ Facebook: https://www.facebook.com/SQLWithBert
Views: 362 Bert Wagner
SQL Server Multiple Recursive Member CTEs
 
06:34
Recursive CTEs are helpful for solving certain types of problems in SQL Server. But did you know that you can write CTEs with MULTIPLE recursive statements? Learn how in this week's episode. Subscribe and turn on notifications to never miss a weekly video: https://www.youtube.com/c/bertwagner?sub_confirmation=1 Related blog post with full example code goodness: https://bertwagner.com/2018/08/21/fizzbuzz-and-multiple-recursive-member-ctes/ Itzik Ben-Gan's article on multiple recursive member CTEs: https://www.itprotoday.com/software-development/ctes-multiple-recursive-members Follow me on Twitter: https://twitter.com/bertwagner
Views: 333 Bert Wagner
The GO Command in SQL Server Management Studio
 
03:01
You've probably seen the GO command in SSMS generated scripts - but do you know when to use it and how to fully utilize its functionality? Related blog post with example code: https://bertwagner.com/2018/05/29/what-does-the-go-command-do/ Twitter: https://twitter.com/bertwagner
Views: 715 Bert Wagner
3 SQL Dev Tools I Can't Live Without
 
03:15
While SQL Server Management Studio is excellent for writing queries and managing databases, it does not do everything that I need when working with SQL Server (nor do I think it should!). Today I want to share with you 3 of my favorite SQL related tools that I use on a regular basis. Related blog post with more demos and links to the tools: https://bertwagner.com/2018/04/10/3-essential-tools-for-the-sql-server-developer/ Twitter: https://twitter.com/bertwagner Facebook: https://www.facebook.com/SQLWithBert
Views: 308 Bert Wagner
Does SQL table join order matter?
 
14:10
Have you ever wondered if the order of the tables in your FROM clause matter? In today's video, we look at why theoretically table join order *does* make a difference for performance and why SQL Server doesn't use the order you provide. We also look at different techniques for forcing SQL Server to use the join order you specified. Blog post with all demo code and links: https://bertwagner.com/2017/11/21/does-the-join-order-of-my-tables-matter/ Presentation by Adam Machanic on row goals: https://sqlbits.com/Sessions/Event14/Query_Tuning_Mastery_Clash_of_the_Row_Goals Music by Joakim Karud http://youtube.com/joakimkarud Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 1294 Bert Wagner
A Better Way To Create Scripts for Multiple SQL Database Objects
 
04:17
Have you ever wanted to generate the CREATE scripts for many database objects at once without having to right click on every single table, index, stored procedure, etc... Today we look at the Generate Scripts Task, the most efficient way to generate CREATE scripts for multiple objects at once in SQL Server Management Studio This week's related blog post with screenshots and details: https://bertwagner.com/2018/01/02/a-better-way-to-script-database-objects/ Music by Joakim Karud http://youtube.com/joakimkarud Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 439 Bert Wagner
Power Query vs DAX with Eugene Meidinger
 
04:24
Power BI has two languages to help you manipulate your data. This week we're in the kitchen with Power BI expert Eugene Meidinger to learn when to use Power Query vs DAX in Power BI. Eugene's blog post with more information: http://www.sqlgene.com/2018/04/03/m-vs-dax-chopping-broccoli-vs-planning-a-menu/ Related blog post with code snippets: https://bertwagner.com/2018/03/27/at-time-zone-the-easy-way-to-deal-with-time-zones-and-daylight-savings-time/ Twitter: https://twitter.com/bertwagner Instagram: https://www.instagram.com/codewithbert/ Facebook: https://www.facebook.com/SQLWithBert
Views: 879 Bert Wagner
My Favorite SSMS Shortcut (After Copy/Paste)
 
02:57
I like the process of query writing to be as efficient as possible and I bet you do too. In today's video, I show you my most used SQL Server Management Studio keyboard shortcut (besides copy and paste) that helps me write queries faster and with fewer mistakes. Blog post with all demo code and links: https://bertwagner.com/2017/11/28/multiline-edit-block-selection-alt-highlight-trick/ Music by Joakim Karud http://youtube.com/joakimkarud Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 591 Bert Wagner
4 Ways to Reduce Reads in SQL Server for faster performance
 
08:08
This week we take a look at 4 techniques to improve query performance by reducing IO reads. My SQL Data Partners Podcast episode on SQL Injection: http://sqldatapartners.com/2017/12/06/episode-120-sql-injection/ Last week's blog post about how to understand Statistics IO: https://bertwagner.com/2017/12/05/how-to-use-statistics-io-to-improve-your-query-performance/ This week's related blog post with links: https://bertwagner.com/2017/12/12/reducing-the-number-of-reads-in-your-queries/ Music by Joakim Karud http://youtube.com/joakimkarud Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 560 Bert Wagner
Does The Order Of Index Columns Matter?
 
06:26
Have you ever wanted to create an index to improve SQL query performance but were unsure of what columns to include or what order to put them in? This video will explain everything you need to know to understand how SQL row store indexes work. Subscribe and turn on notifications to never miss a weekly video: https://www.youtube.com/c/bertwagner?sub_confirmation=1 Related blog post with examples and graphics: https://bertwagner.com/2018/09/04/does-the-order-of-index-columns-matter/ Follow me on Twitter: https://twitter.com/bertwagner
Views: 339 Bert Wagner
Time zone conversions with SQL Server's AT TIME ZONE
 
02:57
Traditionally converting dates between time zones and accurately handling daylight savings time has been a huge pain. SQL Server 2016's AT TIME ZONE feature makes this a little easier. Related blog post with code snippets: https://bertwagner.com/2018/03/27/at-time-zone-the-easy-way-to-deal-with-time-zones-and-daylight-savings-time/ Twitter: https://twitter.com/bertwagner Facebook: https://www.facebook.com/SQLWithBert
Views: 486 Bert Wagner
Rolling Back Temporal Tables
 
08:26
Temporal tables are great because if you make a mistake you can just roll back to the data from your historical table...right? Yes, but it's not that easy. There's no built-in method to "roll-back" data in a temporal table. A roll-back is possible though with some SQL querying; watch the video to see how it's done! Full blog post with demo code: https://bertwagner.com/2017/05/30/how-to-roll-back-data-in-a-temporal-table/ Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/ Elsewhere on the internet: https://blog.bertwagner.com https://twitter.com/bertwagner
Views: 631 Bert Wagner
How NOLOCK causes blocking
 
07:54
You probably know that SQL queries with NOLOCK hints can return inconsistent data, but did you know your NOLOCK queries can prevent other queries from running? It's a common misconception that a WITH (NOLOCK) query hint will force your SELECT statement to not take out any locks. This is incorrect though because *all* SELECT statments, adorned with NOLOCK or not, take out a schema stability lock. In this video we learn what a schema stability lock does and how it can create problems on your server, including delaying index maintenance jobs and blocking other SELECT queries (even those with NOLOCK!) from running. Blog post with example queries: https://bertwagner.com/2017/10/10/how-nolock-will-block-your-queries/ Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 1199 Bert Wagner
OR vs UNION ALL - is one better for performance?
 
03:55
Sometimes the easiest way to improve the performance of a SQL query is to rewrite the query using different syntax. Today we look at how it's sometimes possible to rewrite a query from using ORs to UNION ALLs in order to achieve better performance. Related blog post with example queries: https://bertwagner.com/2018/02/20/or-vs-union-all-is-one-better-for-performance/ Twitter: https://twitter.com/bertwagner Instagram: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for my weekly newsletter here: http://eepurl.com/cMkYl1
Views: 285 Bert Wagner
One SQL Cheat Code For Amazingly Fast JSON Queries - SQL JSON Index performance
 
10:41
How non-persisted computed column indexes make your JSON queries high performance. Did you know that non-persisted columns actually get saved to the index pages? This makes JSON querying incredibly fast in SQL Server. Please like and subscribe if you enjoyed this video! Blog post: https://bertwagner.com/2017/05/09/one-sql-cheat-code-for-amazingly-fast-json-queries/ Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/ Elsewhere on the internet: https://bertwagner.com https://twitter.com/bertwagner
Views: 2002 Bert Wagner
The EASIEST Way To Find SQL Query Errors
 
03:29
Did you know that there's a faster way to pinpoint the syntax errors in your SQL queries than relying on SSMS's difficult to interpret error line numbers? Watch today's episode to learn how. Blog post with additional screenshots: https://bertwagner.com/2018/01/30/the-fastest-way-to-locate-errors-in-your-sql-query/ Music by Joakim Karud http://youtube.com/joakimkarud Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: http://eepurl.com/cMkYl1
Views: 458 Bert Wagner
Why is varchar(max) getting truncated?
 
03:31
Have you ever tried to fit more than 8000 characters into a variable defined as varchar(max) (or nvarchar(max)) only to see your data get truncated? Today we explore why this happens and how to fix it, allowing you to create really long SQL strings. Related blog post with example code: https://bertwagner.com/2018/05/15/why-is-my-varcharmax-variable-getting-truncated/ Twitter: https://twitter.com/bertwagner Instagram: https://www.instagram.com/bertwagner/ https://www.instagram.com/sqlwithbert/ Facebook: https://www.facebook.com/SQLWithBert
Views: 255 Bert Wagner
How to Use the SSMS Clipboard Ring
 
01:34
Have you ever wanted to paste something from memory that wasn't what you just immediately copied to the clipboard? The SQL Server Management Studio Clipboard Ring lets you do exactly that. Blog post: https://blog.bertwagner.com/one-ssms-trick-that-will-make-you-a-faster-query-builder-57d0b1cdc7b1 Follow me on Twitter: https://twitter.com/bertwagner Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 207 Bert Wagner
Displaying Long Variable Values in SQL Server
 
03:50
Displaying long values while maintaining their formatting in SQL Server Management Studio is not as straight forward as you might think. Today, I show you three different ways of printing lengthy field or variable values that will work in SQL Server 2008+. Be sure to subscribe and watch new SQL Server videos every week: https://www.youtube.com/c/bertwagner?sub_confirmation=1 Blog post with demo code: https://bertwagner.com/2018/08/07/displaying-long-values-in-ssms/ Erik Darling's T-SQL Tuesday #104 post with more tips on working with dynamic SQL: https://www.brentozar.com/archive/2018/07/tsql2sday/ Yildirim Kocdag's stored procedure for printing long strings: https://www.codeproject.com/Articles/18881/SQL-String-Printing Follow me on Twitter: https://twitter.com/bertwagner
Views: 162 Bert Wagner
Power BI: Dashboards, Reports, and Datasets with the SQL Chefs
 
03:43
What's the difference between Dashboards, Reports, and Datasets in Microsoft Power BI? Join us for the web's best Power BI themed cooking show to learn the differences from Business Intelligence expert Eugene Meidinger. Check out Eugene's blog post with LOTS of more information: http://www.sqlgene.com/2018/10/02/sqlchefs-power-bi-datasets-reports-and-dashboards/ Subscribe and turn on notifications to never miss a weekly video: https://www.youtube.com/c/bertwagner?sub_confirmation=1 Follow Eugene on Twitter: https://twitter.com/SQLGene Follow Bert on Twitter: https://twitter.com/bertwagner
Views: 510 Bert Wagner
Performance Tuning with Statistics IO
 
08:08
There's no on way to performance tune a query. Today, I show you my preferred way to get started using a quick and easy technique that everyone should have in their arsenal. Blog post with all demo code and links: https://bertwagner.com/2017/12/05/how-to-use-statistics-io-to-improve-your-query-performance/ Music by Joakim Karud http://youtube.com/joakimkarud Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 419 Bert Wagner
How to Automatically Delete Historical Data From a Temporal Table
 
04:15
Temporal Tables are awesome but they sure do accumulate historical data quickly. Today we discuss how to automatically purge old data out of a temporal table's history table, and some of the caveats that come along with doing so. Blog post with code samples: https://bertwagner.com/2017/07/04/how-to-automatically-purge-historical-data-from-a-temporal-table/ Follow me on Twitter: https://twitter.com/bertwagner Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 598 Bert Wagner
What's Join Elimination?
 
10:06
Join elimination is one of the many techniques that the SQL Server query optimizer uses to create efficient query plans. Check out the full post with demo code at SQLPerformance.com: https://sqlperformance.com/2018/06/sql-performance/wp-content/uploads/2018/06/word-image-8.png
Views: 259 Bert Wagner
Is your ORM vulnerable to SQL Injection?
 
04:01
Someone recently told me that they don't need to worry about SQL injection vulnerabilities because they are using an ORM. Oh boy. In this episode I show you a few different ways that ORMs are vulnerable. Want to learn how to protect yourself from SQL injection attacks? Join me at the online GroupBy conference on March 16, 2018 https://groupby.org/ Related blog post: https://bertwagner.com/2018/03/06/2-5-ways-your-orm-will-allow-sql-injection/ Twitter: https://twitter.com/bertwagner Instagram: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for my weekly newsletter here: http://eepurl.com/cMkYl1
Views: 293 Bert Wagner
Generating Multi-Object JSON Arrays in SQL Server
 
09:11
Sometimes you want to do as much processing on your SQL Server as possible before returning any data back to your app or report. Today, we take a look at how to return a JSON array from SQL Server that contains DIFFERENT types of objects in it - something that is not as easy as it may sound. This week's related blog post with demo code: https://bertwagner.com/2017/12/22/how-to-create-json-multi-object-arrays-in-sql-server/ Music by Joakim Karud http://youtube.com/joakimkarud Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 749 Bert Wagner
FAKING Temporal Tables with Triggers
 
04:56
For T-SQL Tuesday #106 I share one of the few times I use triggers in my code: to fake temporal table functionality in older versions of SQL Server. Subscribe and turn on notifications to never miss a weekly video: https://www.youtube.com/c/bertwagner?sub_confirmation=1 Related blog post with examples and graphics: https://bertwagner.com/2018/09/11/faking-temporal-tables-with-triggers/ And another blog post about how to use ACTUAL temporal tables in SQL Server 2016+: https://bertwagner.com/2017/07/19/how-to-use-sql-temporal-tables-for-easy-point-in-time-analysis/ This month's T-SQL Tuesday #106 invitation post: https://voiceofthedba.com/2018/09/03/t-sql-tuesday-106-trigger-headaches-or-happiness/ Follow me on Twitter: https://twitter.com/bertwagner
Views: 321 Bert Wagner
Extracting JSON Values Longer Than 4000 Characters
 
03:45
The JSON_VALUE() function in SQL Server does a pretty good job at extracting values from JSON. It does however have some limitations - today we explore how to get around its 4000 character output limit. Subscribe and turn on notifications to never miss a weekly video: https://www.youtube.com/c/bertwagner?sub_confirmation=1 Related blog post with example ocde: https://bertwagner.com/2018/09/18/extracting-json-values-longer-than-4000-characters/ Follow me on Twitter: https://twitter.com/bertwagner
Views: 118 Bert Wagner
What I learned in Brent Ozar's Master Index Tuning Class
 
06:15
Last week I was a student in Brent Ozar's Master Index Tuning class. I loved the class and want to share with you how it went, as well as what I found to be one of the most helpful things I learned. Related blog post: https://bertwagner.com/2018/06/12/prioritizing-index-performance-pains-what-i-learned-from-brent-ozars-master-index-tuning-class/ Brent's Master Index Tuning class: https://www.brentozar.com/product/mastering-index-tuning/ Twitter: https://twitter.com/bertwagner
Views: 499 Bert Wagner
Convert JSON to CREATE TABLE Statements
 
06:29
In this episode I share a query I wrote to automatically parse a JSON object into SQL Server CREATE TABLE statements. Related blog post with example code: https://bertwagner.com/2018/05/22/converting-json-to-sql-server-create-table-statements/ Github: https://github.com/bertwagner/SQLServer/blob/master/JSONtoSQLGenerator.sql Twitter: https://twitter.com/bertwagner
Views: 554 Bert Wagner
Importing GeoJSON Data Into SQL Server
 
07:49
Today we're looking at how to import GeoJSON earthquake data into SQL Server. We'll use SQL Server's JSON functions as well as the geography data type and spatial functions to transform and make the data ready for analysis. Blog post with demo code and example data: https://bertwagner.com/2018/01/16/importing-geojson-earthquake-data-into-sql-server/ Music by Joakim Karud http://youtube.com/joakimkarud Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 355 Bert Wagner
Hardcoding Lookup Values In SQL Queries
 
04:34
Sometimes you need to define a set of lookup values in an ad-hoc query. In today's video we look at 4 different ways of doing this and the pros and cons of each. Related blog post with example code: https://bertwagner.com/2018/06/05/4-ways-to-define-lookup-values-in-a-query/ Twitter: https://twitter.com/bertwagner
Views: 373 Bert Wagner
5 Business Problems You Can Solve Using Temporal Tables
 
09:24
In this video we examine five real-world scenarios showing how temporal tables can reduce the amount of time you spend writing analysis queries. Featuring my cat Charlie as the "Heartless Manager." Original blog post: https://bertwagner.com/2017/06/20/5-business-problems-you-can-solve-with-temporal-tables/ Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/ Elsewhere on the internet: https://blog.bertwagner.com https://twitter.com/bertwagner
Views: 550 Bert Wagner
How to use the old legacy cardinality estimator in SQL Server
 
02:06
So you upgraded to the latest and greatest version of SQL Server expecting improved performance, but instead your queries are taking LONGER to run! This *could* be due to the new cardinality estimator introduced in SQL Server 2014. Today we'll look at a few ways you can revert back to the legacy cardinality estimator to immediately fix poor performing queries. Blog post with example queries: https://bertwagner.com/2017/09/19/how-to-make-your-queries-perform-like-they-used-to/ Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 167 Bert Wagner
How to Search SQL Query Text in Stored Procedures and Ad-Hoc Queries
 
04:44
Have you ever wanted to search across all queries on your SQL Server? In today's video, we take a look at how to search the SQL query body/text of ad-hoc queries, stored procedures, functions, and views. Blog post containing code templates for easy copy/pasting: https://bertwagner.com/2017/11/14/how-to-search-stored-procedures-and-ad-hoc-queries/ Previous video that talks about searching for implicit conversions: https://youtu.be/mLcDzxCTfHY Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 375 Bert Wagner
4 Misconceptions About SQL Injection
 
05:40
SQL injection continues to be one of the leading reasons for data breaches. Many people (incorrectly) assume that after more than 20 years of exploits in the wild, automatic protections MUST exist against SQL injection. In this week's video we take a look at why that and some other beliefs about SQL injection are incorrect. Blog post that goes along with this week's video: https://bertwagner.com/2017/11/07/4-common-misconceptions-about-sql-injection-attacks/ PASS Security Virtual Group: http://security.pass.org/ Presenting November 14, 2017 at 1PM Eastern about preventing SQL injection in your databases. Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 238 Bert Wagner
JSON Filtered Indexes
 
05:01
Generally, it's possible to get really fast query performance with JSON in SQL Server by building appropriate indexes on your data. But what if you want to add an index conditionally, only on certain rows? Filtered indexes can work, but there are a few things to be aware of. Related blog post with example code: https://bertwagner.com/2018/05/01/is-it-possible-to-conditionally-index-json-data/ Twitter: https://twitter.com/bertwagner Instagram: https://www.instagram.com/bertwagner/ https://www.instagram.com/sqlwithbert/ Facebook: https://www.facebook.com/SQLWithBert
Views: 118 Bert Wagner
Filtering Tables, Stored Procedures, and Other Objects in SSMS
 
02:53
Have you ever had to navigate a database that had hundreds or thousands of objects in it? Scrolling through and searching for the table, procedure, or function you need can be tedious...that's why you should use SSMS object filters instead. Related blog post: https://bertwagner.com/2018/06/26/filtering-tables-procedures-and-other-objects-in-ssms/ Twitter: https://twitter.com/bertwagner
Views: 179 Bert Wagner
How to Put SQL Column Names Onto Multiple Lines in SSMS
 
01:27
It's annoying when you copy and paste a query from somewhere and all of the columns in the SELECT statement are all on the same line. Today we look at how to format this single line of column names into multiple lines in SQL Server Management Studio, WITHOUT using any special plugins or tools. Original blog post: https://blog.bertwagner.com/how-to-put-sql-column-names-onto-multiple-lines-in-ssms-6089d674d8b9 Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/ Elsewhere on the internet: https://blog.bertwagner.com https://twitter.com/bertwagner Major thanks to Bryce from Skyview Plaza for recording the sweet opening metal guitar riff. Check out his band: https://www.facebook.com/skyviewplazamusic/ NEED YOUR HELP: this feature (along with other RegEx find/replace queries) is broken in SSMS 2017. Please vote up this Connect item to make sure Microsoft fixes it before 2017 is officially released https://connect.microsoft.com/SQLServer/feedback/details/3136802
Views: 253 Bert Wagner
How to Generate a RUNNING TOTAL in SQL Server
 
01:44
Generating a running total column in SQL Server used to be a huge pain. Starting with SQL Server 2012, window functions make doing the same thing easy. Blog post: https://blog.bertwagner.com/heres-a-quick-way-to-generate-a-running-total-in-sql-server-f5654d310030 Follow me on Twitter: https://twitter.com/bertwagner Want to receive the latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 437 Bert Wagner
How To Parameterize SQL Table Names
 
02:48
Do you know how to safely pass in a table name or column name parameter value into your dynamic SQL query? sp_executesql won't allow you to parameterize SQL object names. You have to revert back to building dynamic SQL and appending those parameter values to your SQL string. In this video we examine how to do so safely without opening yourself up to SQL injection attacks. Links below. Blog post with example queries: https://bertwagner.com/2017/09/05/how-to-safely-parameterize-table-names/ Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 554 Bert Wagner
Code You Would Hate To Live Without (T-SQL Tuesday #104 Invitation)
 
03:03
This week I invite you to share code you've written that you would hate stand to live without as part of T-SQL Tuesday #104! Official T-SQL Tuesday #104 blog post: https://bertwagner.com/2018/07/03/code-youd-hate-to-live-without-t-sql-tuesday-104-invitation/ T-SQL Tuesday Rules: http://dataeducation.com/t-sql-tuesday-rules-of-engagement/
Views: 212 Bert Wagner
Clean up Ugly SQL Function Syntax with CROSS APPLY
 
01:25
Ever nest REPLACE() functions 29 levels deep? I have…and there’s a better solution to that problem. You can use CROSS APPLY in SQL Server in order to clean up the appearance of your queries without sacrificing performance. Watch this 60 second tip to find out how. Links below. Blog post: https://blog.bertwagner.com/how-to-eliminate-ugly-nested-replace-functions-2f56b1120d53 Follow me on Twitter: https://twitter.com/bertwagner Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: https://upscri.be/c77fc8/
Views: 453 Bert Wagner