How to create index in SQL from c#
The scenario is as follows. I need to drop a particular index at the beginning of the C# application. After all the insert sql statements which are part of processing are complete, I need to create the index again.
The reason I need index drop and creation as part of the application is because I will be giving this application to the deployment team. The deployment team will then be running the application in production.
Is inline sql the best way to create an index - clustered or non-clustered in SQL server from C#?
Or is it there any other way?
you can use ExecuteNonQuery and simply send along a CREATE INDEX command.