Adding included columns to indexes using SMO

Posted by Greg Low on SQL Blog See other posts from SQL Blog or by Greg Low
Published on Fri, 28 May 2010 05:50:00 GMT Indexed on 2010/05/28 6:03 UTC
Read the original article Hit count: 289

Filed under:
A question came up on the SQL Down Under mailing list today about how to add an included column to an index using SMO. A quick search of the documentatio didn't seem to reveal any clues but a little investigation turned up what's needed: the IndexedColumn class has an IsIncluded property. Index i = new Index (); IndexedColumn ic = new IndexedColumn (i, "somecolumn" ); ic.IsIncluded = true ; Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!...(read more)

© SQL Blog or respective owner