Category: SQL

  • Finding non-printable characters in MSSQL

    String fields in MSSQL accept non-printable characters such as tabs, line breaks, etc. When your application has not prevented this characters from being removed and you want to determine if these characters exist in your field, the UNICODE is your friend to answer this question.

    (more…)

  • SQL Server ALTER TABLE ADD Column

    This article covers SQL Server ALTER TABLE ADD Column Statement. In addition, we will learn how to add a value for the columns in the default value and update a value later in a large table. You must also add new columns to a table to be added by database developers.

    I would have thought it would be a little difficult adding columns in SQL Server databases. Occasionally, you may add the columns in SQL Server management studio itself. That’d be perfect for a smaller table that doesn’t have many transactional items to add column SQL on an existing table using structured query language.
    (more…)

  • CASE Statement in SQL (Practical Examples)

    What is a SQL case statement? Well, it’s much like a switch statement in a development language. It allows you to test several different cases for a field and determine what you would like to do for each one with SQL Server.

    (more…)

  • SQL substring between two characters

    I’m starting to feel like a broken record when I say one of my favorite things to do is write functions that will leverage the SQL server substring to select from the starting position of your first character, string, or delimeter aka your input string. I’ve previously written a String Extract Extension Method with C# and of course I’ve also written a StringExtractComponent for CakePHP in case you’re interested in something similar in different programming languages.
    (more…)

  • Switching from App session to SQL session state

    When you have a single web server, storing the user sessions on the single server works perfect; however, when you have multiple web servers and users need to potentially round robin between servers or you need to remove servers from the pool and don’t want to affect your user’s experience enter: SQL Session State.

    (more…)