All, I am using sql server 2008r2. A few weeks ago; I successfully copied one of my tables with indexes and keys without the data. I remember right clicking and copying. I remember I needed to make sure in options that indexes and keys were checked. But now; when I write click; theres no option for copying and pasteing. I have only the option to script create, alter etc.
Does anyone know how I can create a copy of a table with indexes and keys intact?
On SSMS, click on databases node and right click on the database where your table is in. Choose Tasks from context menu.
Then there is Generate Scripts
From the dialog screens, you can choose your table, and set advanced script options even to script data or other details