-
index only ddl
Hi,
I am working with SQL Server 2005 Express. What I would like to do is extract only the indexes from a database and apply them to another database. Looking at the Utility to create the SQL scripts, it does not give the ability to generate just the index ddl (Primary Key, Foreign Key, indexes, etc).
Is there a way to do this without including the tables in the DDL?
Thanks
-
You can script all indexes in a table in ssms.
-
thank you for the response,
I have tried to use ssms, but to get the index DDL you have to create the table DDL. I was hoping to find a way to generate just the index ddl for all tables in a given database.
-
Click on indexes under a table in ssms and go to object explorer details panel, you'll see all indexes in the table. Highlight all of them, right click then choose script indexes as -> create to -> where you want to put the script.
-
Is there a way to multi select all tables in a database and have the ssms generate just the index DDL - not the table DDL?
-