Generate a temp table using Select * INTO #
I've used this in the past when I wanted to generate a temp table manually but do not want to type up the statements, or don't know what the final data types will be. With this, I can simply identify the data I need, insert it using INTO #temp, and then execute this to generate the create statement I need.
I wrote this a few years ago so I'm sure someone can improve on it, but figured it was worth sharing anyway. It may not work for all column data types as I've only included the ones I've needed so far.