Skip to content

News

New Silverlight solution launched at www.goBigBanners.com! Go check it out... just click the Launch Designer button and design your own custom banner.

redgate SQL Source Control… how’d I live without it?

December 5, 2011

For several years, I’ve used tools in the redgate SQL Toolbelt to perform amazing tasks in SQL Server.  My favorite Toolbelt tools include SQL Prompt, SQL Compare, SQL Data Compare and SQL Dependency Tracker.  If you are not familiar with these tools and SQL Server is even a small part of your life, I recommend taking a look because they truly transform your efficiency and accuracy when developing and maintaining SQL Server databases.

I recently decided it was time to take a look at the redgate SQL Source Control solution and am once again giddy over another outstanding redgate product.  Just as their introduction states, I was up and running within minutes and found the solution to be so intuitive, it’s like I’ve been using it for years.  I am now able to skip several steps in my deployment process, making deployments easier and even less error-prone than before.  I continue to be impressed with the quality products redgate offers, and for the incredible impact their products have on the products and services I offer to my customers.  Thank you redgate!

Issue connecting Nook Color to WI-FI network

December 5, 2011

Today I helped a friend troubleshoot an issue where he could not connect his new Nook Color to his WI-FI network. After chasing several dead-ends, we found that configuring his router (D-LINK DIR-615) to use G-Only instead of Mixed B/G/N was the solution. Here’s the article that gets kudos:

http://bookclubs.barnesandnoble.com/t5/NOOK-Color-Support/Issue-connecting-Nook-Color-to-Open-wifi-Cisco-WAP4410N/td-p/863968

SQL Tips – Remove Time Part from SQL DATETIME Value

November 24, 2010

This is my first blog entry.  How exciting!  I thought I’d just pick a simple SQL topic to get started.  Maybe it will help someone and I’ll learn how to create a blog entry in the process.

Scenario

I want to write a SQL statement to return accounts for a date range provided by my user.  If the user enters a date range from 11/20/2010 to 11/22/2010, I really want to return all accounts created between 11/20/2010 and 11/22/2010 23:59:59.  However, I don’t want to make my user worry about the time part, so I need to solve this in my SQL statement.

Let’s pretend I have the following two accounts that were created within this range.  Notice that I store the time part and that the time part for the account created on 11/22 was created at 8:00 PM.

ID CreatedOn
12AAC58D-9A37-4736-885B-C152B0DAA134 2010-11-21 20:19:50.717
E5786969-0209-4AF8-A64D-CDBCF7186C74 2010-11-22 20:00:25.360

Problem

The following SQL statement will only return the first row.  That’s the problem, because we want both rows.

SELECT ID, CreatedOn
FROM dbo.Account
WHERE CreatedOn
        BETWEEN '11/20/2010' AND '11/22/2010'

Solution

My solution to depends on the version of SQL Server I get to use… Prior to SQL Server 2008, the following SQL statement does the trick.  It converts the CreatedOn value to a 10 character string, then converts that string to a DATETIME value.  Since the time part was dropped when converting to string, the new value after casting back to DATETIME is without the time part and we get the desired result… both rows returned.

SELECT ID, CreatedOn
FROM dbo.Account
WHERE CAST(CONVERT(NVARCHAR(10), CreatedOn, 101) AS DATETIME)
        BETWEEN '11/20/2010' AND '11/22/2010'

With SQL Server 2008, we get new data types for DATE and TIME (along with other helpful types).  The following SQL statement simply casts the CreatedOn value to a DATE type, which drops the time part, giving us the desired result.  I like this because it’s easier to write, remember, read and will perform better.

SELECT ID, CreatedOn
FROM dbo.Account
WHERE CAST(CreatedOn AS DATE)
        BETWEEN '11/20/2010' AND '11/22/2010'

Conclusion

I shared a quick tip to remove the time part from a DATETIME value in SQL and a scenario that would motivate you to do so.  The solution depends on your version of SQL Server.  Prior to SQL 2008, convert the value to string, then convert that string back to DATETIME.  With SQL 2008 and later, simply cast the value to a DATE.

Silverlight Online Design Tool Launched at www.goBigBanners.com

November 17, 2010

I’ve been working hard on a cool Silverlight 4.0 solution where you can design a banner online. Check it out at http://goBigBanners.com and let me know what you think. I will be sharing some lessons learned while developing this solution in future Blog posts. I leaned heavily on other Blogs for many of the advanced features, and am happy to give back to the community.