I am creating table(TestTable) in sql using the below code in c#, now i am trying to specify a primary index for this table on col2, can anyone suggest me how to achieve this through code.
Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2012"];
Table tb = new Table(db, "TestTable");
Column col1 = new Column(tb, "Name", DataType.NChar(50));
Column col2 = new Column(tb, "ID", DataType.Int);
tb.Columns.Add(col1);
tb.Columns.Add(col2);
tb.Create();