Database Fundamentals #13: Data Entry Through T-SQL

Database Fundamentals
T-SQL provides lots of functions that help to make data entry through T-SQL much more powerful. Over time you won’t be typing everything into T-SQL directly as we’ll do here. You’ll be able to use stored procedures and parameters to automate the use of scripts. These will also be generated or used by applications. To  start using T-SQL, you need to open a query window. You can do this by right clicking on a database and selecting the “New Query” command from the context menu. This will open a new query window in the main window on your screen. This is basically just a big, open text box into which you can type commands. The INSERT Statement To add rows using T-SQL, the principal statement is the INSERT statement. The…
Read More

Database Fundamentals #12: Adding Data with SSMS GUI

Database Fundamentals
In the previous Database Fundamentals, I argued that you should be learning T-SQL, yet the very next post I'm showing you how to use the GUI. What's up? Why the GUI? It's a very simple reason. I want to show you what it is so that I'm not hiding things. However, showing it to you will quickly expose the weaknesses inherent in using the SSMS GUI for direct data manipulation. It's a poor choice. However, we'll understand how it works at the end of this post. I'll also cover it in other posts, showing how to UPDATE and DELETE data using the GUI. They will further illustrate the weaknesses. You will however know how it works. Data Entry through the GUI If you are not already connected to the server,…
Read More

Azure, PowerShell, Databases and the PASS Summit

Azure, PowerShell
I am quite honored to say that I am speaking at the single largest and most important Microsoft Data Platform conference in the world, PASS Summit 2017. Now, I'm excited to say that I get to speak on three topics that are near and dear to my heart, Azure, PowerShell and databases. The session is called Using PowerShell to Manage Your Azure Databases. You can read the abstract there at the link. I'm going to go through a whole bunch of the database types on Azure and show how you can manage each. I'm not sticking to SQL Server. We'll cover MySQL, Cosmos and others. Let's get together and talk about these topics. Azure adoption is growing like mad. You're going to need to automate it, so PowerShell is your…
Read More

Database Fundamentals #11: Why Learn T-SQL

Database Fundamentals
If you've been following along with the previous 10 Database Fundamentals blog posts, you have a SQL Server installed and a database with a table in it. You may have more if you've been practicing. Now would be the time to start adding data to the database, but first, I want to talk about the importance of T-SQL Why T-SQL? The way SQL Server accepts information is very different than most programs you’re used to using. Most programs focus on the graphical user interface as a mechanism for enabling data entry. While there is a GUI within SQL Server that you can use for data entry, and I will do a blog post on it, the primary means of manipulating data within SQL is the Transact Structured Query Language, or…
Read More

Speaking at IT/DevConnections 2017

Misc
If you're going to be in the San Francisco area in October, let's get together and talk. I'll be at IT/DevConnections 2017 doing several talks. First, I have an all day pre-con on the tools needed for query tuning. Then I have two regular sessions, DevOps for the DBA and Monitoring to Quickly Diagnose SQL Server Performance Problems. Let's get together and talk.
Read More

Database Fundamentals #10: Modifying Tables

Database Fundamentals
Invariably, either while building a new database, or while maintaining old ones, you will find that the business needs change or that you’ve made a mistake. Either way, you will need to modify the tables that you’ve created. Change is inevitable and luckily SQL Server takes that into account, providing you with mechanisms to modify structures after you’ve created them. Important Warning One of the fundamental concepts of databases is that the data is stored. You can’t simply throw data away when you need to make a change to a table. There are two levels of changes you can make to a table. The first, is a change that won’t affect data in the table. These are simple changes and we’ll cover them in this blog post. The second level…
Read More

Database Fundamentals #9: Schemas As Containers

Database Fundamentals
Schemas are a very useful tool for managing the objects in your database. From security through process, through placement, schemas provide you with another tool to control how your database behaves. Schemas The tables created so far in this blog series have all been attached to a schema, dbo. Depending on how you login to the server and the security settings for your user, this is usually the default schema. A schema is simply a container in which you place objects. Once placed there, a schema is a method for managing the objects it contains. Schemas give you a simple way to control placement of the objects on filegroups. Schemas are a very easy way to manage security. The use of schemas becomes extremely important as your database becomes more…
Read More

Luck and the PASS Summit

PASS
I recently read an article asking the question whether or not we downplay the role that luck plays in our lives and I immediately thought of the PASS Summit. Obscenely Lucky I am, quite frankly, embarrassingly, obscenely, stupidly lucky. I just am. I married WAY over my head. I stumbled into an amazing career. I can safely say that I've arrived where I am through a great amount of luck. I am quite grateful for it all too. I will only suggest a single point of agency on my part that has put me in this wonderful situation. I showed up. PASS Summit 2005 I went to the PASS Summit in 2005 in Grapevine. Mostly, I attended sessions and then went back to my hotel. However, one night, after talking…
Read More

Ich werde Deutschland beriesen

Misc
Guten Tag! OK, switching back to English for the rest of this. I'm going to be spending a few weeks in Germany on a private tour, no work. That means that, no, I'm very sorry, I can't speak at your user group, even though I'd love to. Next time. However, I wanted to let you know when and where I'll be over there. I'd love the chance to meet with friends. I know I owe several of you a beverage. This is a chance to pay it back. Here's where I'll be and when: 9/12: Frankfurt Airport (we'll be in late, glad to meet for a drink at the hotel) 9/13 - 9/15: Amsterdam (yeah, not Germany, Mrs. Scary requested this) 9/15 - 9/16: Off the radar, visiting my German…
Read More

Database Fundamentals #8: All About Data Types

Database Fundamentals
SQL Server provides all different kinds of data types in order to give you more flexibility and control for how you store your data. You define these data types as you define the columns in your tables. If you wanted to store information about the date and time that a purchase was made online you’re going to store the values in a column, or columns, that define dates and times in order to ensure accuracy in your data. Choosing a Data Type You could make the data type into one that stores just about anything you give it, such as one of the character types like char or varchar. Do this and you’re going to run into issues when you start running queries against that data. For example, your business…
Read More