I’m currently putting together some notes on a series I’d like to share with all of you. This series will cover the fundamentals of Transactional SQL (T-SQL). I’m hoping that it will grow into an introduction to database development. I’ll begin with the very basics of what a database is, and what SQL is. Then…
Category: Microsoft SQL
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…
Sample Databases Available for Download
Whenever someone starts learning Microsoft SQL Server they always ask for a demo database they can connect to. If you don’t have access to one already there is hope. Search on amazon and see how cheaply you can find a copy of Microsoft SQL Server 2000 Developer edition. I’ve found them as low as $50. …