We have dozens of tables that are built programmatically and sometimes they need to be rebuilt. We use these tables as searchindex tables. Rebuilding the tables is done by dropping the current tables programmatically and rebuilding and filling them from scratch.
However, we would like to preserve all indexes that are added to the tables. Those indexes are added by MsAzure in auto pilot mode. Does anyone know C# code or a SQL query that will return a script that can be run afterwards to rebuilt the previous indexes. I know you can generate those scripts in SSMS but we want to do it programmatically because the amount of tables...