You can script a table from database using a SQL Server Management Studio.
SQL Server Management allows you to script out tables from database using a Script table as option.
This option can be used either to create the table or drop and create the table.
Lets see how you can use Script table as option to generate a script for table.
Following are the steps:
First open SQL Server Management Studio then connect to a server instance.
Next expand the database folder, then expand the Database as shown below.
Now under the database, expand the Tables folder, and right click on table then Point to Script Table as point to CREATE TO then New Query Editor Window.
Here we are scripting a table named HumanResources.Department of database AdventureWorks2017.
Once click on New Query Editor window, you will see a create table script for this table is generated in query editor window.
When you execute this script, it will create a same table with schema.
Similarly, you can script a table using Script table as for other option such as DROP and CREATE TO and other.
1,818 total views, 2 views today