Another quickie today. Don't ask why, but this morning I was trying to programmatically work out which tables have foreign-key references to table Sales, because they're preventing fast partition switching on table Sales. After more spelunking around I thought I had it with this code: SELECT * FROM sys.all_objects WHERE [type] = 'F' AND [parent_object_id] [...]