When it comes down to primary keys, most of us that have been working with databases for a while have come across a few million different ones. Some work fairly well. Some just don’t work at all and should be banned from ever being used as a primary key again. First, let’s delve into what…… Continue reading Primary Keys – Good and Bad
Category: SQLBasics
Windowing Functions Exercises
So, using the Lahman’s baseball database – found here – let’s go thru some practice exercises to try out your new windowing functions skills: Find the first year that each park was played inShow the rank with ties (both ways) of the games started in 1983 for each league for all playersPlace the players into…… Continue reading Windowing Functions Exercises
Processes
Every now and again, you’ll hear someone in IT say the word “process.” What does that really mean? Is it just a “black box” that data is shoved into and, magically, a file is created or a dashboard show you your data? https://youtu.be/kx3sOqW5zj4 Kinda how my “process” works According to Dictionary.com, a process is simply…… Continue reading Processes
Data Loss
In our last post, we quickly mentioned the phrase “data loss”. What does that really mean? Well, according to Wikipedia, data loss is “an error condition … in which information is destroyed by failures or neglect in storage, transmission, or processing.” The important part that I want to talk about there, is the “neglect in… processing.” Sadly,…… Continue reading Data Loss
Try/Catch vs RAISERROR
Now I’m sure after the last post , you’re thinking “Oh, ever-so humble author, why, oh, why, would I pick one of these over the other?” Well, I’m glad you’re checking in today, because that’s exactly what we’re going over! Now, the easiest scenario is if the SQL Server you’re working with is somewhere between…… Continue reading Try/Catch vs RAISERROR
More ways to stop errors
Errors can be the bane of a developer’s existence. They can stop even the best developer’s work. A process that takes several hours can be stopped dead in it’s tracks in the last hour because of a horrible error. Thankfully, last time, we discussed one way to make a stored procedure more aware of errors…… Continue reading More ways to stop errors
Making Stored Procedures Bulletproof
So last time in Stored Procedures – Why we talked briefly about ways of making stored procedures more bulletproof. First off, you have to ask yourself, should we? I mean, the data we work with is a known thing every time, right? Can people just blindly enter data in? Haven’t our apps been built to…… Continue reading Making Stored Procedures Bulletproof
Stored Procedures – Why
So, last time we discussed why do we really want to use a stored procedure. One of the big things I said was, “so that my blocks of code can be re-used several times now and in the future. ” This statement, at least to me, forms the building block for stored procedures. They allow…… Continue reading Stored Procedures – Why
Stored Procedures
So, in our last post – Back to Basics – we went over what a stored procedure was and what goes into it. Now, let’s show you a simple stored procedure. CREATE PROCEDURE StoredProcedureTest AS SELECT 1/1 GO I know. I know. You thought we were going to begin by building skyscrapers, instead, we’re trying to find cinder…… Continue reading Stored Procedures
Back to Basics
Welcome to the New Year everyone! After debating with myself and talking to a few colleagues/peers over the last few weeks, I’ve decided that I have gotten away from my original sense of purpose for this blog. It’s time to fix that! My original idea was to have this blog be a place where people…… Continue reading Back to Basics