database and right click on the database as shown below
"Generate Scripts." from the sub menu of "Tasks" context menu that appears when
you clicked on database name
Database for which you want to generate the script. Here I selected TempDB1 and
appropriate script options which ultimately depend on your need. Some options
which are toggled from false to true by me are marked with arrow. Click next
when you are done with your options settings.
objects of the database for which you want to generate the script like tables,
stored procedures etc. Currently I have only tables in my database so wizard is
showing only "Table" as database object . Select your database object and click
table for which you want to generate the script you can select all of them by
single click of select all or by individual selection by checking the checkbox.
After selecting your tables click next.
output option. You can generate output in clipboard, in new query window of SQL
server management studio or in a file stored at your specified location. After
selecting appropriate option click next.
review your selection at the script wizard summary page. After reviewing your
selection summary click finish
the script is generated...