Combine the sugar and 2 cups water in a medium saucepan, bring to a boil over high heat and cook until the sugar is completely melted, about 2 minutes. Remove from the heat, add the espresso beans and let sit at room temperature for 30 minutes.
Strain, cover and refrigerate until very cold, at least 2 hours.
Fill 8 tall glasses with ice. Add about 1/4 cup of the espresso syrup to each glass. If desired, add a shot of vodka and coffee liqueur with the syrup and stir well. Fill to the top with club soda.