This question already has an answer here:
When I right-click a table in Object Explorer and click "Script Table" I can get SSMS to script my table.
Can I do that with T-SQL code?
I'm after the "CREATE TABLE xx" code that SSMS generates, so that I can take the script and use on other projects. I need all the bits and pieces, including PRIMARY KEY, CONSTRAINTs, "WITH (PAD_INDEX = " and schema declaration.
I'm on SQL Server 2014