SQL Server 2005ÖÐÊý¾ÝÍÚ¾òËã·¨À©Õ¹·½·¨
ÕªÒª£º±¾ÎĽ«½éÉÜSQL Server 2005 Analysis ServicesÖÐÊý¾ÝÍÚ¾òËã·¨À©Õ¹·½·¨£¬ÔÚƽʱ¿ª·¢ÖÐÎÒÃÇÐèÒª¸ù¾ÝÒªÇóÀ´À©Õ¹SSASµÄÍÚ¾òËã·¨¡£
±êÇ©£ºSQL Server 2005 Êý¾ÝÍÚ¾ò Ëã·¨
SSASΪÎÒÃÇÌṩÁ˾ÅÖÖÊý¾ÝÍÚ¾òËã·¨£¬µ«ÊÇÔÚÓ¦ÓÃÖÐÎÒÃÇÐèÒª¸ù¾Ýʵ¼ÊÎÊÌâÉè¼ÆÊʵ±µÄËã·¨£¬Õâ¸öʱºò¾ÍÐèÒªÀ©Õ¹SSAS£¬Ê¹ËüÄÜÓ¦Óøü¶àµÄËã ·¨£¬SSASÓбȽϺõĿÉÀ©Õ¹ÐÔ£¬ËüÌṩÁËÒ»¸öÍêÕûµÄ»úÖÆÀ´½øÐÐÀ©Õ¹£¬Ö»Òª¼Ì³ÐһЩÀಢ°´Êʵ±µÄ·½·¨½øÐÐ×¢²á¾Í¿ÉÒÔÔÚSSASÖÐʹÓÃ×Ô¼ºµÄËã·¨ÁË¡£
ÏÂÃæÎÒ½«Í¨¹ýʵÀý·Ö±ðÓü¸ÆªÎÄÕÂÀ´½éÉÜÒ»ÏÂÈçºÎ¿ª·¢SSASËã·¨²å¼þ¡£±¾ÎĽéÉܵÄËã·¨²å¼þ¿ª·¢·½·¨ÊÇ»ùÓÚÍйܴúÂëµÄ£¬ÊÇÓÃC#¿ª·¢µÄ£¨Ëã·¨²å¼þÒ²¿ÉÒÔÓÃC++¿ª·¢£¬²¢ÇÒSQLSERVER2005µÄ°¸ÀýÖи½´øC++°æ±¾µÄ´úÂëstub£©¡£Õû¸ö¹ý³Ì´óÖÁΪÁù¸ö²½Öè¡£ÔÚ¿ªÊ¼¿ª·¢Ö®Ç°ÐèÒª×öһЩ׼±¸¹¤×÷£¬¾ÍÊÇҪȥÏÂÔØ Ò»¸öÓÃC++±àдµÄCOM×é¼þ£¬½ÐDMPluginWrapper£¨¿ÉÒÔͨ¹ýÏÂÔر¾Îĸ½´øµÄ¸½¼þ»ñµÃ£©£¬Ëü×÷ΪSSASÓëËã·¨²å¼þµÄÖмä²ã£¬ÓÃÓÚ´¦Àí SSASÓëËã·¨²å¼þÖ®¼äµÄ½»»¥ÒÔ¼°·â×°´ÓSSASµ½Ëã·¨²å¼þµÄ²ÎÊýºÍ´ÓËã·¨²å¼þµ½SSASµÄ´¦Àí½á¹û¡£DMPluginWrapper¡¢SSASºÍËã·¨²å ¼þÖ®¼äµÄ¹Øϵ¿ÉÒÔÓÉÏÂͼÀ´ÃèÊö¡£
ͼ±í 1: DMPluginWrapper¡¢SSASºÍËã·¨²å¼þÖ®¼äµÄ¹Øϵ
ÏÂÃ濪ʼ´´½¨Ëã·¨À©Õ¹µÄÏîÄ¿¡£
Ê×ÏÈн¨Ò»¸öÀà¿âÏîÄ¿£¨ÃûΪAlgorithmPlugin£©½«¸Õ²ÅµÄDMPluginWrapperÏîÄ¿ÒýÓõ½Ð½¨µÄÕâ¸ö AlgorithmPluginÀà¿âÏîÄ¿ÖС£Äã¿ÉÒÔÑ¡ÔñΪÕâ¸öÀà¿âÏîÄ¿½øÐгÌÐò¼¯Ç©Ãû£¬ÕâÑù¾Í¿ÉÒÔ½«Æä×¢²áµ½GACÖС£ÁíÍ⻹ҪΪ DMPluginWrapperÌí¼ÓºóÉú³É½Å±¾½«³ÌÐò¼¯×¢²áµ½GAC£¬²Î¿¼½Å±¾ÈçÏ£¨¸ù¾Ý»úÆ÷¾ßÌåÉèÖöø¶¨£©£º
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe" $(TargetPath)
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /u $(TargetName)
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /if $(TargetPath)
Èç¹ûµÚÒ»Ðнű¾²»ÄÜÕýÈ·ÔËÐеĻ°£¬Ëã·¨²å¼þÊDz»Äܱ»SQLSERVER·ÖÎö·þÎñÆ÷ʶ±ðµÄ¡£ÁíÍâÁ½Ðнű¾¾ÍÊǽ«Ëã·¨³ÌÐò¼¯×¢²áµ½GAC¡£
½ÓÏÂÀ´µÄ¼¸¸ö²½ÖèÖ÷ÒªÊǼ̳ÐһЩ»ùÀàµÄ¹¤×÷£¬°üÀ¨AlgorithmMetadataBaseÀà¡¢AlgorithmBaseÀàºÍ ICaseProcessor½Ó¿ÚºÍAlgorithmNavigationBaseÀà¡£Ê×ÏÈÔÚAlgorithmPluginÖÐн¨Ò»¸öÀàÎļþ²¢ÃüÃûΪ Metadata£¬ÎªÕâ¸öÀàÌí¼ÓComVisible¡¢MiningAlgorithmClass(typeof(Algorithm))ºÍGuidÊôÐÔ (AlgorithmÊÇ
Ïà¹ØÎĵµ£º
Select CONVERT(varchar(100), GETDATE(), 23)£»
·µ»ØÐÎʽ£º2008-11-29
Select CONVERT(varchar(100), GETDATE(), 102)
·µ»ØÐÎʽ£º2008.11.29
Select CONVERT(varchar(100), GETDATE(), 101)
·µ»ØÐÎʽ£º11/29/2008
¸ü¶àÏêÇéÇë²Î¼ûÈçÏÂÁÐ±í£º
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 ......
½¨±í£º
CREATE TABLE [DB.dbo].tableName
(Stud_id int CONSTRAINT constraintName1 not null primary key,
Name nvarchar(5) not null,
Birthday datetime,
Gender nchar(1),
Telcode char(12),
Zipcode char(6) CONSTRAINT constraintName2 CHECK(zipcode like [ ......
CREATE Table <±íÃû>
£¨[<ÁÐÃû1>] ÀàÐÍ (³¤¶È) [ȱʡֵ][Áм¶Ô¼Êø]
[£¬<ÁÐÃû2> Êý¾ÝÀàÐÍ[ȱʡֵ][Áм¶Ô¼Êø]]….
[£¬UNIQUE£¨ÁÐÃû[£¬ÁÐÃû]….£©]
[£¬PRIMARY KEY£¨ÁÐÃû[£¬ÁÐÃû]…£©]
&n ......
ÈçºÎÔÚSQLÖÐÆôÓÃÈ«ÎļìË÷¹¦ÄÜ£¿
¡¡¡¡--------------------------------------------------------------------------------
¡¡¡¡È«ÎÄË÷ÒýµÄÒ»¸öÀý×Ó£¬ÔÚ²éѯ·ÖÎöÆ÷ÖÐʹÓãº
¡¡¡¡use pubs
¡¡¡¡go
¡¡¡¡--´ò¿ªÊý¾Ý¿âÈ«ÎÄË÷ÒýµÄÖ§³Ö
¡¡¡¡execute sp_fulltext_database 'enable'
¡¡¡¡go
¡¡¡¡--½¨Á¢È«ÎÄĿ¼ft_titles
¡¡¡ ......
Ò»¡¢ ¼òµ¥²éѯ
¡¡¡¡¼òµ¥µÄTransact-SQL²éѯֻ°üÀ¨Ñ¡ÔñÁÐ±í¡¢from×Ó¾äºÍWHERE×Ӿ䡣ËüÃÇ·Ö±ð˵Ã÷Ëù²éѯÁС¢²éѯµÄ±í»òÊÓͼ¡¢ÒÔ¼°ËÑË÷Ìõ¼þµÈ¡£
¡¡¡¡ÀýÈ磬ÏÂÃæµÄÓï¾ä²éѯtesttable±íÖÐÐÕÃûΪ“ÕÅÈý”µÄnickname×ֶκÍemail×ֶΡ£
¡¡¡¡SELECT nickname,email
¡¡¡¡from testtable
¡¡¡¡WHERE name='ÕÅÈý'
......