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?

Answers


you can use ExecuteNonQuery and simply send along a CREATE INDEX command.


Need Your Help

How do I determine which monitor my winform is in?

c# .net winforms .net-3.5 .net-2.0

I have been up and down this site and found a lot of info on the Screen class and how to count the number of monitors and such but how do I determine which montitor a form is currently in?

WPF Ribbon Samples

.net wpf visual-studio-2010

I installed WPF Ribbon 2010, and the WPF Ribbon Samples.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.