û¸É¹ýÕâÊ£¬Ò²²»ÖªµÀoracleÊý¾Ý¿âɶÑù£¬Çë½Ì´óϺÃǾßÌå²½ÖèÊÇʲô£¿ÐèҪעÒâЩʲô£¿
ÊÇÕû¸ö¿âµÄÊý¾Ý»¹ÊÇ±íµ¥?
Õæ¸öÊý¾Ý¿â
Õû¸öÊý¾Ý¿â£¬ÁíÍâÎÒÊÇ´Óһ̨װÓÐoracleµÄµçÄÔµ¼Èëµ½Áíһ̨װÓÐsql serverµÄµçÄÔÖС£¶àл£¡
¸ÕgoogleÁËÏ£¬Ò²Ã»ÕÒµ½oracle µ¼ÈëSQL serverµÄ·½·¨,Ö»ÕÒµ½Á˸öSQL server ºÍ oraclµÄÁ¬½Ó£¬ Èç¹û¿ÉÒÔ£¬Á¬½ÓÉÏÁ˾ͿÉÒÔʹÓÃÁË£¬¾Í²»Óõ¼ÈëÁË°É.
Â¥Ö÷¿ÉÒÔÊÔÊÔ..
ÒÔSQL Server 2000ΪÀý˵Ã÷SQL Serverµ½OracleÁ¬½Ó·þÎñÆ÷µÄ¾ßÌåʵÏÖ¹ý³Ì¡£
1.ÒªÇópc»úÉÏ°²×°oralce¿Í»§¶ËÈí¼þºÍsqlserver2000Èí¼þ¡£
2.¿Í»§¶ËµÄÅäÖÃtnsnames.oraÎļþ£¬ÅäÖÃËùÒªÁ¬½ÓµÄÊý¾Ý¿â·þÎñÆ÷£¨windows£¬unixµÈƽ̨¾ù¿ÉÒÔ£©
eg£ºtnsnames.ora
......
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.90)(PORT = 1521))
)
(CONNECT_DATA =
(sid = blue)
(SERVER = DEDICATED)
)
)
......
3.ÅäÖÃwindowsµÄODBCÊý¾ÝÔ´£º
¿ªÊ¼²Ëµ¥—¡·ÉèÖס·¹ÜÀí¹¤¾ß—¡·Êý¾ÝÔ´£¨ODBC£©—¡·½øÈëÅäÖÃÓû§DSN»òÕßϵͳDSN¾ù¿ÉÒÔ£ºÌí¼Ó—¡·Ñ¡ÔñMicrosoft ODBC for oracle—¡·×Ô¶¨ÒåÊý¾ÝÔ´Ãû³Æ£¨×îºÃ¸útnsÖÐÁ¬½Ó´®Í¬Ãû£¡£©—¡··þÎñÆ÷Ãû³Æ£¨±ØÌÌîдtnsÎļþÖеÄÁ¬½Ó´®Ãû³Æ£©—¡·Íê³É¡£
Ïà¹ØÎÊ´ð£º
ÎÒ°²×°SQL SERVER2008µÄʱºòÑ¡ÔñWINDOWSÉí·ÝÑéÖ¤Á¬½ÓµÄ£¬ÎÒ²»ÖªµÀÔõôдÁ¬½Ó¡£¡£¡£
»¹ÓÐÎÒÏë¸Ä³ÉSQL SERVERÉí·ÝÑéÖ¤Ôõô¸Ä£¿£¿
лл´ó¼ÒÁË£¡
XML code:
<configuration>
<appSettings>
& ......
sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001
ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......
@s='S1,S2,S12,S23';
½«@sÀïÃæµÄS1,S2Ìæ»»³É´¦Àí£¬Î´´¦Àí
À´ÕßÓзÖ.
REPLACE(@s,'S1,S2','´¦Àí,δ´¦Àí')
REPLACE ²»ºÃÓà ×Ô¼ºÊÔÏÂ
SQL code:
declare @s ......
ÏÖÓбí Term
½á¹¹ÈçÏÂ
time1 time2 idterm
2009-2-15 2009-6-30 11
2009-9-10 2010-1-15 12
Èç¹ûÊäÈë 2009-4-25 ÔòÓ¦¸ÃÈ¡³öidterm 11
Èç¹ûÊäÈë 2009-12-5 ÔòÓ¦¸ÃÈ¡³öidterm 12
......
ÔõôʹÎÒÿ´Î²»ÊǸüÐÂÊý¾Ý¿â
¶øÊǸ²¸ÇÉϴεÄËùÓмǼÄØ£¡
ÒòΪÓÐʱºòʱ¼äÌõ¼þ²»Í¬
SQL code:
select * from hwouttb where
CAST(REPLACE(REPLACE(REPLACE(outdate,'Äê','-' ),'ÔÂ','-'),'ÈÕ','') AS ......