Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Using sys.index_columns Expand / Collapse
Author
Message
Posted Tuesday, December 20, 2011 10:41 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, February 25, 2014 3:17 PM
Points: 657, Visits: 130
Nice question on something I don't believe I've ever thought much about. I learned something!

Thanks, can't wait for your next!
Post #1224639
Posted Tuesday, December 20, 2011 1:12 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, December 18, 2014 10:56 AM
Points: 3,417, Visits: 2,035
Nice question. Keep 'em coming!
Post #1224731
Posted Wednesday, December 21, 2011 4:01 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 4:21 PM
Points: 7,928, Visits: 9,653
Good question. The formatting wasn't an issue for me, I just pasted the answers into notepad and started to put line breaks and spaces where I would put them if writing SQL - and realised before I finished that I would be wasting time doing any more formatting as the four answer options were identical apart form a couple of column names, which made it all pretty clear (apart from remembering which of the column ids was the id in the parent table).

I think the explanation is slightly wrong, though, as it seems to suggest that key_ordinal is the same as index_column_id in all entries in sys.index_columns for anything except columns of clustered indexes; but actually this can only be true for key columns, since for non-key columns key_ordinal is always 0.


Tom
Post #1225004
Posted Thursday, December 22, 2011 4:12 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 6:02 AM
Points: 1,012, Visits: 1,008
Thank you for the question

Iulian
Post #1225705
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse