Tag: SQL

  • Accessing and Transacting Languages in SQL Server

    Over the last few posts, we’ve discussed DDL and DML. This week I want to actually discuss the other 2 types of languages with SQL Server – DCL and TCL. DCL is the Data Control language. These are the commands that give security permission to a person – or group – to get things done.…

  • How to Define objects

    In my last post, I discussed some of the DML commands in SQL Server. This week I want to discuss another category of commands – Data Definition Language, or DDL. DDL is used to define or redefine the structure of the database. The commands that are used for DDL are as follows: CREATE DROP ALTER…

  • Unique Categories of Commands within SQL

    For a while now, I’ve been talking about specific functions used within SQL Server. For example, I’ve talked about DATALENGTH, REPLICATE, and STUFF, along with many others. And all that is great and should be known if you work with SQL Server on a regular basis. But today, I want to talk about the different…

  • Grouping Items in Such A Way

    Last time, we were able to go over a way to group data that is probably not familiar to many. This time, I want to go over an extra piece to that puzzle that should add even more functionality to your repertoire when it comes to data functionality. First, we have the basic query that…

  • Getting Data to Group Better

    A lot of the time you’re going to be asked to group items. Sometimes, you have to look at the exact same data in multiple ways. It can be just flat ugly to look at but it does what you need to. Well, today we can talk about a way to make it a bit…

  • Quoth the Raven… Nevermore

    Sometimes you’ll find a fun little function that can actually help you out a lot with your coding. Today’s function is just that for me. When I first heard about QUOTENAME, I was like “This is rather useless. It just puts brackets around whatever. I can do it just as easily hard-coding the strings.” Truly,…

  • STUFF that can make your life easier

    Time for some real talk, my friends. When I first started working with SQL Server, I learned how to program in quite possibly the worst way possible – from “experts” who had just been let go from the company I worked at. For a good month, I walked through every bit of SQL code I…

  • Ain’t Nothing Like Saying STUFF this & Moving On

    Previously, we talked about the REPLACE and TRANSLATE functions and how similar, but not quite the same they are. Today, I want to talk about yet another function that does something similar but not quite the same. Today, I want to discuss the STUFF function and how it can add or even replace parts of…

  • Doing Something with the REPLACE function

    Most of us have used the REPLACE function several times in our daily lives. This function, as you may remember, takes one string and replaces it with another, as seen below: There is another function within SQL Server that many people think does the same thing, but with a slight nuance. Sometimes, you just need…

  • Unicode Data and Keeping DBAs Happy

    In our last session together, one of the many items we talked about was the fact that I asked that you use the DATALENGTH function instead of the LEN function because you could be using UNICODE data. The LEN function is used in SQL to find out – surprise, surprise – the length of a…