SQL - free gaps between defined intervals

Hello!

I’ve got simple table:

ID INT
ID_RESOURCE INT
START_DATE DATETIME
STOP_DATE DATETIME

Sample data:

1, 1, 2013-01-01, 2013-01-05
2, 1, 2013-01-10, 2013-01-12

I want to write a query to return every free periods between my min and max dates (in this case 2013-01-06 - 2013-01-09 is free gap for resource ID=1).

I would be grateful for any help.