I’d like to introduce you to the idea that you can replace an equal sub query with an exists sub query. Doing this can change a seek operation to a scan operation. This usually results in a faster query, with fewer resources used. Check out this example using the adventureworks database. USE AdventureWorks GO –…
Tag: SQL
Microsoft SQL Reporting Services for PHP
In an outstanding move on Microsoft’s part, Developers have released an open-source project to help PHP developers integrate SQL Server Reporting Services from their PHP applications! Using this new toolkit programmers can begin doing that today! This project offers a simple programming interface to: list available reports manage rendering of those reports and allow parameter…
Azure Tables or SQL Azure?
I’m beginning to see questions come up over “which should I use, SQL Azure or Azure Table Services?” The answer for now seems to be, “it depends.” Azure Tables seem to have better pricing. The scalability also seems to be a push. SQL Azure will be quicker to learn for most of us, since it…
Sorting Numbers in VarChar field
Over at Experts-Exchange, I saw a question I get every once in a while. It all has to do with how SQL Server orders data in a VARCHAR column. SQL Server tries to sort a VARCHAR column in a dictionary order, 0 comes before 1. The problem is you may have mixed numbers in your…
Migrating Databases to Azure
When converting a database from an older version of Microsoft SQL to Azure, there will be many gotchas along the way. I’d like to help you learn from the troubles I had along the way, hopefully sparing you a bit of time that was lost during my first conversion. Getting Started I’m going to assume…
SQL Injection License Plate
While it would be nice to put my knowledge of SQL to work in such a way, I highly doubt this injection attack would do much to prevent getting a ticket. But it should make you consider the possibility that this code could do damage to one of your projects, should someone try to enter…
SQL Session – Execution Extract, Transform, and Load your Data Warehouse
If you’re not already a member of the Charlotte SQL Server User Group, go now and sign up. This group is a great resource of knowledge and connections to the SQL Server community in Charlotte, NC. Their plan is to get together once a month and discuss a new and interesting topic on SQL Server….
SQL Session – Execution Plan Caching and Reuse
If you’re not already a member of the Charlotte SQL Server User Group, go now and sign up. This group is a great resource of knowledge and connections to the SQL Server community in Charlotte, NC. Their plan is to get together once a month and discuss a new and interesting topic on SQL Server….
SQL Session – Inside SQL Server 2008 Resource Governor
If you’re not already a member of the Charlotte SQL Server User Group, go now and sign up. This group is a great resource of knowledge and connections to the SQL Server community in Charlotte, NC. Their plan is to get together once a month and discuss a new and interesting topic on SQL Server….
Code Review
I’d like to start a new series that will help you learn some of the techniques I’ve used in the past. Some of these techniques are useful, some aren’t. Using SQL is a constant learning process. You have to be willing to look at your solutions and throw out those ideas that no longer work…