Category: SQL

How to use SQL to Extract a Number from a String

Recently I had a need to extract the number from a string in the database.  The string would be something like ‘Monitor 16″‘ or “16 inch Monitor”.   I would need to get the size for various reasons including fees

Posted in Developement, How To, SQL Tagged with: ,

SQL Function – Find a Value in a String of Values

In a table I have a field that you can use comma delimited value (example 1,2,3,22). When I tried to filtering use a “LIKE” statement on the value 2, I was being returned 2 and 22. ARG! So what do

Posted in SQL Tagged with:

MaxMind GEOIP Look-up for Microsoft SQL

Recently I implemented a GEOIP solution on a client site; however, the site was built on a Microsoft SQL database engine and I could not find a solution for looking up the country name easily.  Through some quick Google searches

Posted in Developement, How To, SQL, Web Tagged with:

SQL Pagination

I have often encountered the culture of query for thousands of results, estimate the paging and then only display a small segment of the results that were retrieved from the database. This is particularly bad in a web environment. This

Posted in Better Coding, SQL

Checking Active Process on Sql Server

I have needed to monitor the SQL servers a little more than usual. I am mostly concerned about memory and CPU usage. By properly setting our program names in the SQL connection string, I am able to find the offending

Posted in How To, SQL Tagged with: ,