Sql Server Management Studio - Script Table AS feature

I find it interesting if I right click  on a table and select

SCRIPT TABLE AS - CREATE TO - New Query Editor Window ,

The output of it does not show all indexes that were created on table.
Why is that?
So if used the output to recreate the table again, not all the indexes that were there will get recreated.

I am user SQL Server Management 2008.
Who is Participating?
QuinnDexConnect With a Mentor Commented:
to include indexes right click the database

generate scripts.

select specific database objects

expand tables and select the table you want to script


click advanced then change to true the attributes you want to include in the script
metro156Author Commented:
Not to be a know it all - After you right click the database, you first must select Tasks and then Generate scripts. Then the rest you mentioned is correct.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.