This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based: Croy, Steve (2005) Display-attributes-made-simple/setcolor [Source code]. http://search400.techtarget.com/tip/Display-attributes-made-simple | |
// -------------------------------------------------- | |
// Procedure name: RtnDspAtr | |
// Purpose: Return Display Attribute hex code that can be used on a | |
// screen to set color, underline, or other attributes. | |
// Returns: DSPATR hex value | |
// Parameter: Color Value - Text representing a color 'GRN' (default) | |
// other values: 'BLU' 'PNK' 'RED' 'TRQ' 'WHT' 'YLW' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Change THETABLENAME to the table you want to reference. It must already exist. | |
WITH T1 ( Table_Name, Table_Prefix, Table_Prefix2) As ( values( Ucase('THETABLENAME'), 'T1.', 'T2.' ) ) | |
, I1 (INDEX_NAME, INDEX_SCHEMA, Table_Name, Table_Prefix, Table_Prefix2 ) as ( | |
Select I1.INDEX_NAME, I1.INDEX_SCHEMA, t1.Table_Name, t1.Table_Prefix, t1.Table_Prefix2 | |
From SYSINDEXES I1 | |
Join T1 Using (Table_Name) | |
ORDER BY CASE | |
WHEN IS_UNIQUE = 'U' then 1 |