In a previous post I introduced you to calculated fields, and mentioned there were many other functions you could use to compute values or columns. It’s time to introduce you to the eight most used functions when it comes to manipulating strings in SQL LEFT and RIGHT If you ever need the first 3 or…
Search Results for: string manipulation
String Manipulation — CAST and CONVERT
So far I’ve shown you just a few of the many string manipulation functions available in Microsoft SQL. Today we’re adding two more of these tools to your tool belt. CAST and CONVERT. These two become useful when you’ve stored a value as one data type, and later find you need it used as another. …
String Manipulation — REPLACE, PATINDEX and Regular Expressions
In the previous SQL posts, I showed you SUBSTRING, then I showed you REPLACE. Now, with REPLACE, you had to know what characters you wanted to replace. What if you only knew what characters you wanted to keep? Well, let me introduce you to PATINDEX. This is an advanced command that is easy to learn,…
String Manipulation — REPLACE
In the last SQL post, I showed you SUBSTRING, and how you could use it to locate the area code in an un-formatted phone number. The problem was the field we were working from was full of malformed numbers. Today, we’ll start on cleaning up the numbers. But first, I need to include my standard…
String Manipulation — SUBSTRING
Sooner or later in SQL, you’re going to be asked to change how some text is formatted. Making changes to text is pretty straightforward. First, you need to know that when you’re manipulating text (in SQL it’s stored as a VARCHAR or NVARCHAR), you’re manipulating a string. If you think of the string to the…
SQL 101 – Date Manipulation Functions
Welcome back! This post is a followup to the post about string functions. The difference is this time, we’re discussing functions that manipulate dates. GETDATE The most often used function I can think of, with the possible exception of COUNT(*) is GETDATE(). When called this gives you the current datestamp from the server. This gives…
Improve Performance by Replacing Cursors
This is the last article for my upcoming design patterns session. Today we’re going to look into speeding up your queries by replacing cursors, a row-by-row operation with a table value function. Before you start composing that hate-mail on how I’m wrong for not understanding cursors, let me say this: there is a time and…
SQL201-The Syllabus
It’s that time again! Time to start up a new class and cover some more advanced topics in SQL Development. Before beginning these lessons, You need to be comfortable with all the material in my SQL101 series. Specifically you’re going to need to know SELECT, INSERT, UPDATE, and DELETE. With those skills in hand, I’ll…
Microsoft Exam 70-433 (part 3)
I’m putting together a new series to cover the materials you’ll need to know in order to pass the 70-433. Microsoft’s exam that covers Database Development using Microsoft SQL Server 2008. I’m going to list the topics covered in several posts, each one will include links to details to those topics. If you have any…