There was a requirement to create Non-Cluster Index on multiple columns in 200 tables!!! Crazyyyy!!! Isn’t it????
!!! Even 1000 (One Thousands) tables i don’t care !!!
Can we automate this process dynmically using SQLCMD & T-SQL?
***Yes—We Can***
SELECT ‘ CREATE NONCLUSTERED INDEX [ NIDX_’ + SYSCOLUMNS.NAME + ‘] ON ‘ + SYSOBJECTS.NAME + ………………………..GO
—To get the complete code
You must log in to read the rest of this article. Please log in or register as a user.
Log in Register
Your email address will not be published. Required fields are marked *
Comment *
Save my name, email, and website in this browser for the next time I comment.