From the results of the SQL Server stored procedure ‘sp_help’ we get a DataSet containing a couple of tables. Seven if i am correct. One of them contains information about the constraints. Each foreign keys is documented by two consecutive rows in that table. The first row contains the constraint type, it’s name and other details. It’s followed by an empty row except for one column, ‘constaint_keys’ that contains the column names references of the constraint.
Other constraint types are described in one single row.
Any idea on how to “flatten” this information, using Linq, in a way that we can be sure that any couple made of two rows is really made of rows {n, n + 1}
Thank you for your help!
You can use Enumerable.Range() to get the range of indexes you want to work with: