title: Dropping indexes in SQL Server database
body: <p>How do you drop indexes in a SQL Server 2008 database? This is what I've got so far:</p>
  
  <pre><code>declare @procname varchar(500) 
  declare cur cursor 
  for
  select  name from sysindexes 
  open cur
  fetch next from cur into @procname
  while @@FETCH_STATUS=0
  begin
   exec ('drop index ' + @procname)
   fetch next from cur into @procname
    end
   close cur
   deallocate cur
  </code></pre>