selects the correct SQL template
prevent crashes, if no sheet exists