[SQL Server2008]MDX º¯Êý²Î¿¼ (MDX)
MDX º¯Êý²Î¿¼
SQL Server 2008 Áª»ú´ÔÊ飨2009 Äê 7 Ô£©
MDX º¯Êý²Î¿¼ (MDX)
Microsoft SQL Server Analysis Services ÔÊÐíÔÚ¶àά±í´ïʽ (MDX) Óï·¨ÖÐʹÓú¯Êý¡£º¯Êý¿ÉÒÔÔÚÈκÎÓÐЧµÄ MDX Óï¾äÖÐʹÓ㬲¢ÇÒ¾³£ÓÃÓÚ²éѯ¡¢×Ô¶¨Òå»ã×ܶ¨ÒåÒÔ¼°ÆäËû¼ÆËã¡£ ±¾½Ú½éÉÜ Analysis Services ¸½´øµÄ MDX º¯Êý¡£
¿ÉÒÔʹÓÃÏÂÃæÕâЩ±í°´·µ»ØÖµµÄÀà±ðÀ´²éÕÒº¯Êý£¬Ò²¿ÉÒÔ´Ó°´×Öĸ˳ÐòÅÅÁеÄĿ¼Öа´Ãû³ÆÀ´Ñ¡Ôñº¯Êý¡£
Êý×麯Êý
º¯Êý ˵Ã÷
SetToArray (MDX)
½«Ò»¸ö»ò¶à¸ö¼¯×ª»»ÎªÊý×飬ÒÔ±ãÔÚÓû§¶¨Ò庯ÊýÖÐʹÓá£
²ã´Î½á¹¹º¯Êý
º¯Êý ˵Ã÷
Hierarchy (MDX)
·µ»Ø°üº¬Ö¸¶¨µÄ³ÉÔ±»ò¼¶±ðµÄ²ã´Î½á¹¹¡£
Dimension (MDX)
·µ»Ø°üº¬Ö¸¶¨µÄ³ÉÔ±¡¢¼¶±ð»ò²ã´Î½á¹¹µÄά¶È¡£
Dimensions (MDX)
·µ»ØÓÉÊýÖµ±í´ïʽ»ò×Ö·û´®±í´ïʽָ¶¨µÄ²ã´Î½á¹¹¡£
¼¶±ðº¯Êý
º¯Êý ˵Ã÷
Level (MDX)
·µ»Ø³ÉÔ±µÄ¼¶±ð¡£
Levels (MDX)
·µ»ØÓÉÊýÖµ±í´ïʽָ¶¨ÁËÔÚά¶È»ò²ã´Î½á¹¹ÖÐλÖõļ¶±ð£¬»ò·µ»ØÓÉ×Ö·û´®±í´ïʽָ¶¨ÁËÃû³ÆµÄ¼¶±ð¡£
Âß¼º¯Êý
º¯Êý ˵Ã÷
IsAncestor (MDX)
·µ»ØÒ»¸öÖ¸¶¨³ÉÔ±ÊÇ·ñΪÁíÒ»¸öÖ¸¶¨³ÉÔ±µÄ×æÏÈ¡£
IsEmpty (MDX)
·µ»Ø±í´ïʽµÄ¼ÆËã½á¹ûÊÇ·ñΪ¿Õµ¥ÔªÖµ¡£
IsGeneration (MDX)
·µ»ØÖ¸¶¨³ÉÔ±ÊÇ·ñ´¦ÓÚÖ¸¶¨µÄ´úÖС£
IsLeaf (MDX)
·µ»ØÖ¸¶¨³ÉÔ±ÊÇ·ñΪҶ³ÉÔ±¡£
IsSibling (MDX)
·µ»ØÒ»¸öÖ¸¶¨³ÉÔ±ÊÇ·ñΪÁíÒ»¸öÖ¸¶¨³ÉÔ±µÄͬ¼¶³ÉÔ±¡£
³ÉÔ±º¯Êý
º¯Êý ˵Ã÷
Ancestor (MDX)
·µ»Øij¸ö³ÉÔ±ÔÚÖ¸¶¨¼¶±ð»ò¾àÀëÉϵÄ×æÏÈ¡£
ClosingPeriod (MDX)
·µ»Øij¸ö³ÉÔ±ÔÚÖ¸¶¨¼¶±ðÉϵĺó´úÖеÄ×îºóÒ»¸öͬ¼¶¡£
Cousin (MDX)
·µ»ØÓëÖ¸¶¨µÄ×Ó³ÉÔ±ÔÚ¸¸³ÉԱϷ½¾ßÓÐÏàͬµÄÏà¶ÔλÖõÄ×Ó³ÉÔ±¡£
CurrentMember (MDX)
·µ»Øµü´ú¹ý³ÌÖÐÖ¸¶¨µÄά¶È»ò²ã´Î½á¹¹µÄµ±Ç°³ÉÔ±¡£
DataMember (MDX)
·µ»ØϵͳÉú³ÉµÄ¡¢Óëij¸öά¶ÈµÄ·ÇÒ¶³ÉÔ±Ïà¹ØÁªµÄÊý¾Ý³ÉÔ±¡£
DefaultMember (MDX)
·µ»Øά¶È»ò²ã´Î½á¹¹µÄĬÈϳÉÔ±¡£
FirstChild (MDX)
·µ»Ø³ÉÔ±µÄµÚÒ»¸ö×Ó³ÉÔ±¡£
FirstSibling (MDX)
·µ»Ø³ÉÔ±µÄ¸¸³ÉÔ±µÄµÚÒ»¸ö×Ó³ÉÔ±¡£
Item£¨³ÉÔ±£©(MDX)
·µ»ØÖ¸¶¨Ôª×éÖеijÉÔ±¡£
Lag (MDX)
·µ»ØÔÚËùÔÚά¶ÈÖÐλÖñÈÖ¸¶¨³ÉÔ±¿¿Ç°ÇÒ¿¿Ç°Î»ÊýΪָ¶¨Î»ÊýµÄ³ÉÔ±¡£
LastChild (MDX)
·µ»ØÖ¸¶¨³ÉÔ±µÄ×îºóÒ»¸ö×Ó³ÉÔ±¡£
LastSibling (MDX)
·µ»ØÖ¸¶¨³ÉÔ±µÄ¸¸³ÉÔ±µÄ×îºóÒ»¸ö×Ó³ÉÔ±¡£
Lead (MDX)
·µ»ØÔÚËùÔÚά¶ÈÖÐλÖñÈÖ¸¶¨³ÉÔ±¿¿ºóÇÒ¿¿º
Ïà¹ØÎĵµ£º
Êý¾Ý¿â¿ª·¢¹ý³ÌÖУ¬µ±Äã¼ìË÷µÄÊý¾ÝÖ»ÊÇÒ»Ìõ¼Ç¼ʱ£¬ÄãËù±àдµÄÊÂÎñÓï¾ä´úÂëÍùÍùʹÓÃSELECT INSERT Óï¾ä¡£µ«ÊÇÎÒÃdz£³£»áÓöµ½ÕâÑùÇé¿ö£¬¼´´Óijһ½á¹û¼¯ÖÐÖðÒ»µØ¶ÁÈ¡Ò»Ìõ¼Ç¼¡£ÄÇôÈçºÎ½â¾öÕâÖÖÎÊÌâÄØ£¿ÓαêΪÎÒÃÇÌṩÁËÒ»ÖÖ¼«ÎªÓÅÐãµÄ½â¾ö·½°¸¡£
1.1 ÓαêºÍÓαêµÄÓŵã
& ......
DECLARE @T varchar(255),
@C varchar(255)
DECLARE Table_Cursor CURSOR FOR
Select
a.name,b.name
from sysobjects a,
syscolumns b
where a.id=b.id and
a.xtype='u' and
(b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167)
OPEN Table_Cursor
FETCH NEXT from Table_Cursor INTO @T,@C
WHILE(@@FET ......
SQL code
´´½¨½ÇÉ«£¬Óû§£¬È¨ÏÞ
/*--ʾÀý˵Ã÷
ʾÀýÔÚÊý¾Ý¿âpubsÖд´½¨Ò»¸öÓµÓбíjobsµÄËùÓÐȨÏÞ¡¢ÓµÓбítitlesµÄSELECTȨÏ޵ĽÇÉ«r_test
Ëæºó´´½¨ÁËÒ»¸öµÇ¼l_test£¬È»ºóÔÚÊý¾Ý¿âpubsÖÐΪµÇ¼l_test´´½¨ÁËÓû§ÕË»§u_test
ͬʱ½«Óû§ÕË»§u_testÌí¼Óµ½½ÇÉ«r_testÖУ¬Ê¹Æäͨ¹ýȨÏ޼̳лñÈ¡ÁËÓë½ÇÉ«r_t ......
×òÍí£¬µ½Î¢Èí¹Ù·½ÏÂÁËÒ»¸ö32°æ±¾µÄTrial°æ±¾¡£ÎļþÃûΪSQLFULL_x86_ENU.exe¡£Îļþ´óСΪ1.30G×óÓÒ¡£ÒòΪֻÓÐ32λһ¸ö°æ
±¾£¬±ÈSQL Server 2008ÄǸö3GµÄҪС¶àÁË¡£ºÇºÇ¡£
http://www.microsoft.com/sqlserver/2008/en/us/R2Downloads.aspx
ÏÂ
ÔØÍê³Éºó£¬ÏÈжÔØÔÀ´µÄSQL Server 2008¡¡sp2,½á¹ûÕûÕûÔËÐÐÁËÁ½¸ ......