I believe this article was reposted from the original~12 years ago, i'll see if i can recover the links. the proc has gone through a slew of changes since then..matching the created case of all objects, and a ton of improvements.
grab the code snippets form page 8 of this thread: it houses the most updated versions of this code.
there are things this code does not do, temporal tables , in memory optimized, partitioned tables, tables with custom data type names over 16 chars, and a few other exotics, like xml indexes.
let us know if you have any questions in that other thread.
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!