Tips & Tricks

Optimizing T-SQL by use of SHOWPLAN to tune SQL Queries

When writing SQL queries we often measure the performance of the query or procedure by the amount of time it takes to complete. Often I found myself saying that if it completes in a couple seconds then it is good. Lately however I have found myself more concerned with the IO count then with the

Tips & Tricks – Sybase T-SQL: <> does not match null values

When writing SQL we may find that we need to write a WHERE clause that checks if a columns is not a certain value. To do this we have the <> operator that means does not equal. However you may be surprised that you are not getting all the results you expected, this is because

Tips & Tricks: How to use a variable in a TOP clause of T-SQL

You may find that when developing Select queries for an Application that you may want to dynamically limit the results returned from a Stored Procedure. Upon first inspection you may think oh lets use a TOP clause with a limit variable passed in when the stored procedure is called. CREATE PROCEDURE getROWS @limit INT AS

Tips & Tricks: Comparing Text Files in Unix with DIFF command

When working in a unix environment you may find the need to compare the contents of 2 files. To do this unix provides the diff command. The diff command takes 2 files as an argument and outputs the differences between them in a simple easy to understand format using a simple change notation using numbers

Tips & Tricks: Removing ^M from files in unix

When transferring files between Windows and Unix you may find that on occasions your file has been modified and that ^M characters exist at end of lines.  This problem is caused when files are transferred to the server as Binary. However if you change the type to ASCII then you will find that the ^M

Tips & Tricks: Don’t forget you can break out of php mode

Often when developing we often get stuck in the mindset that we have to do everything in the language we are working with. When it comes to PHP this can sometimes lead to line after line of echo statements that do not contain any code but simply HTML or CSS elements. Due to the very

Escaping Single Quotes in Sybase T-SQL

Most individuals having database experience with MySQL will find shortly after using Sybase DBMS that the backslash character does not escape characters. Instead in Sybase T-SQL the single quote itself acts as the escape character. Below is a sample UPDATE statement showing the difference in escaping the single quote character in MySQL and Sybase. MySQL

Tips & Tricks: Ignoring folders and file types with Subversion

Subversion (SVN) is a popular version control system used by developers. Often a developer will find that they have folders or files within their project that they do not want to have saved and versioned. To accomplish this svn provides the ignore property which can be set to tell what not to include. How to