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.
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.
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
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!
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.