There are two ways within SSMS to view the SQL statement (known as Data Definition Language, or DDL) used to create a table.
- Right-click the table and choose "Script Table as", "CREATE To" and choose your destination. This method is easiest if you just want to view the DDL for a single table quickly.
- Right-click the database and choose "Tasks", "Generate Scripts" and follow the prompts. This method will generate DDL for all tables and many other database objects depending on your selection.
Either method will show constraints, indexes and metadata.