Sunday, May 12, 2013

[SQL Server] Create index query for all tables

[SQL Server] Create index query for all tables


Create index query for all tables

Posted: 12 May 2013 02:50 PM PDT

Dear AllI wan to to drop and recreate indexex on all tables using query.I have drop index syntax as followsSELECT 'drop index ' +i.name+ ' on ' +o.name FROM sys.indexes i JOIN sys.objects o ON i.object_id = o.object_idWHERE i.type_desc = 'NONCLUSTERED' AND o.type_desc = 'USER_TABLE'I would like to get the create index syntax using query. Can anybody help?

No comments:

Post a Comment

Search This Blog