Feeds:
Posts
Comments

A friend of mine contacted me through email today having a very common problem with a query he had written.  He received an error, “cannot resolve collation conflict for equal to operator”.

Early in my career I had experienced the same issue so I quickly searched my code snippets and found where I had used COLLATE DATABASE_DEFAULT after each of the comparison columns.  For example

SELECT COLUMN
FROM TABLE_A
INNER JOIN TABLE_B
WHERE TABLE_A.COLUMN COLLATE DATABASE_DEFAULT = TABLE_B.COLUMN COLLATE DATABASE_DEFAULT

If you experience the error “Cannot resolve collation conflict for equal to operator” I hope this solution helps you out.

Have you ever tried to restore a backup over an existing database and receive an error stating the tail of the log for the database has not been backed up? Many times if you are just restoring a database into a development environment you don’t care so you just restore WITH REPLACE and move on.  However if you want to ensure that your restore contains the latest transactions from the production database, simply make a transaction log backup.  Example

(BACKUP LOG [DB_NAME] TO DISK = ‘DRIVE:\PATH\DB_NAME_LOG.BAK’)

Now lets suppose you are working with a production system and something dreadful happens to the database.   Lets assume that you have a transactional database and take TLOG backups every 10 minutes. Now lets suppose at 2:00 in the afternoon a regular TLOG backup is taken and at 2:07 there is a hardware problem where your MDF file becomes corrupt. You now have to restore from backup. What happens to those 7 minutes of transactions?

Without recovering the tail end of the log, this data is gone. Since it was only the MDF file that was corrupt or lost, we can still take a log backup even without the MDF. To do so use

(BACKUP LOG [DB_NAME] TO DISK = ‘DRIVE:\PATH\DB_NAME_LOG.BAK’ WITH NO_TRUNCATE)

The key here is the NO_TRUNCATE statement.  Using NO_TRUNCATE allows you to be able to backup the transaction log without the database being online.  If your database is online you can just take a regular transaction log backup.

If you want to see this in action, check out my video.  In this video I go rouge and delete my MDF file and demonstrate how to backup and restore the tail end of the log.

How to backup and restore the tail end of a transaction log

I had the pleasure of attending SQL Saturday 112 this past weekend.  This was my second time speaking at a SQL Saturday in Birmingham.  I was selected to present two sessions again this year in the first and second time slot.  I started off with “Getting Involved and Getting Ahead”.  This session is all about the SQL Community and how volunteering and giving of your time can pay huge dividends in your career.  You get to learn so much more and at such an advanced rate that the sky is the limit.  While helping others you gain as much or more.  The contacts you make alone are work the investment of your time.

The second session I gave was a brand new session called “Know Backups and Know Recovery”.  I presented this session in March to the Columbus GA SQL Users Group.  I really enjoy this session and hope to make it my primary session I give.  In this session I cover best practices with make FULL, DIFFERENTIAL, and TLOG backups of your databases.  I find that most people are at least doing FULL and Transaction logs.  About 25% do weekly FULL and Daily DIFFERENTIAL backups.  I also have found that most attendees have not practiced restores to include their DIFF and Transaction log backups.  In this session I demo using a script to generate the restore scripts of the last FULL, DIFF and all transaction log backups since the last respective FULL or DIFFERENTIAL backup.  I also demo FILEGROUP backups, peace meal restores and even a TAIL LOG backup and restore.

In between giving these two sessions and the remainder of the day I helped work the RedGate booth and PASS Booth.  I had a great deal of fun helping to spread the word about all things PASS and helping to field questions about many of the RedGate products.  The organization team for SQL Saturday 112 did an excellent job putting on this event.  I really like the speaker shirt and the bags the team got.

The event location at Jefferson State Community College was great.  Large classrooms and a centrally located vendor area.  There was excellent signage leading up the event, schedules posted on the doors to the rooms, a very well put together event guide and tons of drinks, donuts and coffee.

I will definitely be back to this event as long as they are willing to have me.

My slides can be found on the SQL Saturday website here.

Image

I am not one of these anti PC sorta guys, but I do love my MacBook Pro.  I have owned a PC since 1993 when I got my Packard Bell 386 with Windows 3.1.  Even with my MacBook I have 9 Windows flavored VM’s on it.  To be honest, I have never had Windows run better than as a VM on my MacBook.  Due to having so many VM’s the 8 GB of ram I had just didn’t cut it on some occasions.

With wanting to dive more into Windows Failover Clustering and wanting to experiment more with SQL 2012 and “Always On” I knew I needed a bit more horsepower to do all the playing and studying I want “need” to do.  I posed the question to a superior and got the green light to make a modest increase in memory.  I can not wait to put this 16 GB of ram to the test.

Next I hope to get a Thunderbolt enclosure with an SSD to put a few VM’s on.

In just two days SQL Saturday 107 will be in full swing.  Tomorrow begins their precon with the infamous Kalen Delaney.  Those who were lucky enough to sign up and get one of the coveted spots are in for a treat.  Thanks to the Idera ACE program I was blessed to spend three full days with Kalen and pick up a lot of new tips and tricks to help me progress in my career.

I will be presenting two sessions at SQL Saturday 107.  My “You Inherited a Neglected Database” session and “It’s TEMPDB Why Should You Care”.  I recently presented my TEMPDB session in Atlanta and had a rough go at it.  Lets just say I had a very humbling experience and learned a few valuable things as a presenter.  The biggest issue I had was being very nervous.  I had a two fellow ACE’s in the room and several other folks that I know very well or know of.  The room was also at capacity (50+ folks).  I shall be much more calm in Houston and slow down my presentation.  Even though I had a few bumps in my session, I had a very large number of people approach me telling me it was an “awesome” session.  That made me feel much better.

If you are in the Houston area, I hope you are planning to attend this wonderful FREE event on Saturday.

“Why I joined Linchpin People as a Teammate”

It was announced publicly this past weekend at SQL Saturday #111 that I have joined Linchpin People as their first teammate.  My friend Andy who is also a Chief Servant Officer of Linchpin made the announcement during the speaker dinner and gave me an official Linchpin dress shirt.

During the remainder of the speaker dinner and throughout the SQL Saturday event the next day people kept asking me about Linchpin.  I would explain to them the culture of Linchpin and tell them the short story of how it came to be that I was joining such a great outfit.

The primary question I kept getting was ” Are you joining Linchpin full time as a consultant?”.  I had to explain that I was only doing so part time at this point in my career.  (Night and weekend type work)  I would then explain my current job and what all has happened with me in the DBA role over the past 4 years.  I was recently promoted to a lead role and have 4 DBA’s that I am responsible for including mentoring and helping them grow in their career.

My current job is wonderful, I really enjoy the folks I work with and have numerous really cool projects going on.  I started the side business primarily to make a few extra bucks to help fund trips to SQL Saturday’s.  I really enjoy getting to travel around the country speaking and teaching others what I know.  I also get to learn a great deal from attending other sessions and networking with the SQL Community.  In forming my LLC, this awesome opportunity arose with Linchpin.  How could I possibly say no to working with Andy Leonard, Brian Moran, Mike Walsh and Robert Pearl.

It is really nice being the team lead at work, but it is even better being the dumbest guy in the group with Linchpin.  There is so much for me to learn from these guys.  I am really looking forward to absorbing as much as I can from each of them.

Image

I was chosen to speak at SQL Saturday 111 in Atlanta GA this weekend.  I will be doing my session called “It’s TEMPDB, Why Should You Care”.  In this session I cover the importance of TEMPDB and how best to configure TEMPDB in your environment.  Not only do I cover a lot of material on slides which are available to download on the event website, I also break out into a live demo demonstrating contention on TEMPDB and discuss how best to eliminate or reduce the contention.

I have presented this session at a number of other events and always get positive feedback on the technical material in the presentation.  If you don’t know why TEMPDB is important or have not configured TEMPDB after a base install, come hear me speak or just shoot me an email.

Follow

Get every new post delivered to your Inbox.

Join 500 other followers