• declare @cmd varchar (max)

    Select @cmd= "Create index "+IndexName + "......From tblDBAIdxMetadt

    exec (@cmd)

    You got the idea 🙂 I will post a better Query tomorrow.