A quick SQL Server tip

Have you ever wanted to quickly migrate selected table data back and fourth from your dev database to your live database? If the answer is yes then this one's for you.

[More]

Looking for a MySQL equivalent for SQL Server's ISNULL function?

SQL Server has a well known and widely used ISNULL function that actually replaces a null column value or null subquery value with whatever you specify. For example, if you were to write

 SELECT ISNULL(UnitPrice,0)
 FROM InventoryItem

then you would have zeros returned in your result set for all InventoryItem table records that had a NULL value for the UnitPrice field. Ever tried to do that in MySQL? It doesn't work because MySQL's ISNULL function simply returns a value telling you whether or not the argument to the ISNULL function was NULL or not. Not as cool when compared to SQL Server's nifty replace type of functionality now is it? But wait, no need to talk smack about MySQL - for there is another great and easy to use command in MySQL that will give us the same result!

[More]

Date and Time formatting in MySQL

Most developers familiar with SQL Server have employed the easy to use CAST or CONVERT commands in order to properly format a date. Here's a simple example of CONVERT helping us get a value in the format of MM/DD/YYYY.

 SELECT CONVERT(VARCHAR(10), MyDateField, 101) AS MyDateFieldDisplay
 FROM TableName
This is a great command and it's very easy to use - but do you know how to format date and time values in a similar fashion when coding against a MySQL database? You can use the DATE_FORMAT command and here's how...

[More]

BlogCFC was created by Raymond Camden. This blog is running version 5.9.5. Contact Blog Owner