ÐÐÁÐתÖõÄSQLÓï¾ä
ÐÐÁÐתÖõÄSQLÓï¾ä
ÁíÒ»ÖÖÐÐÁÐתÖà -- ¶¯Ì¬ sql ½»²æ±í
===========================================================
×÷Õß: wxy0327(http://wxy0327.itpub.net)
·¢±íÓÚ: 2006.05.10 09:11
·ÖÀà:
Oracle
³ö´¦: http://wxy0327.itpub.net/post/16888/88075
---------------------------------------------------------------
½»²æ±íµÄ¸ÅÄî³£ÔÚSQL ServerÖмûµ½£¬ÐÐÁÐתÖõ¹ÊÇÊý¾Ý¿â¾³£ÒªÓõ½µÄ£¬ÓÈÆäÊDZ¨±í¡£ÕâÀï¸ø³öÁËÒ»¸öOracleµÄ¼òµ¥ÊµÏÖ¡£
CLASS1 CALLDATE
CALLCOUNT
1 2005-08-08
40
1 2005-08-07
6
2 2005-08-08
77
3 2005-08-09
33
3 2005-08-08
9
3 2005-08-07
21
תÖúó£º
CALLDATE CallCount1
CallCount2 CallCount3
------------ ---------- ---------- ----------
2005-08-09 0 0
33
2005-08-08 40 77
9
2005-08-07 ¡¡6 ¡¡¡¡¡¡¡¡¡¡0
21
ÊÔÑéÈçÏ£º
1. ½¨Á¢²âÊÔ±íºÍÊý¾Ý
CREATE TABLE t(
class1 VARCHAR2(2 BYTE),
Ïà¹ØÎĵµ£º
oracle ͬÒå´Ê synonym ΪÊý¾Ý¿â¶ÔÏó½¨Á¢Í¬Òå´Êºó,µ±dba¶ÔÊý¾Ý¿â¶ÔÏó(table,view,ÐòÁÐ)×öÁËÒ»¸ö¼òµ¥¸Ä¶¯Ö®ºó,ÈçÃû×Ö»òÕ߽ṹ¸Ä±ä,Ôò²»ÐèÒªÖØиü¸Ä²¢±àÒëÓ¦ÓÃ.ÔÚÊý¾Ý¿â×ÖµäÖÐÓж¨Òå,²»ÐèÒª½øÐÐÈκδ洢.
oracle±ðÃûalias,With as¡¡Éú³ÉÒ»¸öÁÙʱ±í£¬¶ÔÓÚ¸´ÔÓµÄÊý¾Ý²éѯ£¬¿ÉÒÔ¼õÉÙ×ÊÔ´ÏûºÄ¡¢Ìá¸ßÐÔÄÜ¡£9iÒýÈë¡£
with alias ......
DBOÊÇÿ¸öÊý¾Ý¿âµÄĬÈÏÓû§£¬¾ßÓÐËùÓÐÕßȨÏÞ£¬¼´DbOwner
ͨ¹ýÓÃDBO×÷ΪËùÓÐÕßÀ´¶¨Òå¶ÔÏó£¬Äܹ»Ê¹Êý¾Ý¿âÖеÄÈκÎÓû§ÒýÓöø²»±ØÌṩËùÓÐÕßÃû³Æ¡£
±ÈÈ磺ÄãÒÔUser1µÇ¼½øÈ¥²¢½¨±íTable£¬¶øδָ¶¨DBO£¬
µ±Óû§User2µÇ½øÈ¥Ïë·ÃÎÊTableʱ¾ÍµÃÖªµÀÕâ¸öTableÊÇÄãUser1½¨Á¢µÄ£¬ÒªÐ´ÉÏUser1.Table£¬Èç¹ûËû²»ÖªµÀÊÇÄ㽨µÄ£¬Ôò·ÃÎÊ» ......
ÎÊ£ºÔõÑùÔÚÒ»¸öUPDATEÓï¾äÖÐʹÓñíBµÄÈý¸öÁиüбíAÖеÄÈý¸öÁУ¿
¡¡¡¡´ð£º¶ÔÕâ¸öÎÊÌ⣬Äú¿ÉÒÔʹÓÃÇ¿´óµÄ¹Øϵ´úÊý¡£±¾Ò³ÖеĴúÂë˵Ã÷ÁËÈçºÎ×éºÏʹÓÃfrom×Ó¾äºÍJOIN²Ù×÷£¬ÒÔ´ïµ½ÓÃÆäËû±íÖÐÊý¾Ý¸üÐÂÖ¸¶¨ÁеÄÄ¿µÄ¡£ÔÚÉè¼Æ¹Øϵ±í´ïʽʱ£¬ÄúÐèÒª¾ö¶¨ÊÇ·ñÐèÒªµ¥Ò»ÐÐÆ¥Åä¶à¸öÐУ¨Ò»¶Ô¶à¹Øϵ£©£¬»òÕßÐèÒª¶à¸öÐÐÆ¥Åä±»Áª½Ó±íÖеĵ¥Ò» ......
SQL SERVER DBCCÃüÁî½âÊÍ
°ËµãÖÓÆð´²Ò»Ö±¸ãµ½ÏÖÔÚ£¬ºÃ¶à»¹²»Ì«¼ÇµÃ£¬ÏÈ·ÅÉÏÀ´ÒÔºóÂýÂýÐÞ¸Ä
2007-05-01 12:56:28
---------------------
--1 dbcc trraceon DBCC TRACEOFF
--¶ÔÓÚÊý¾Ý¿âËÀËø£¬Í¨³£¿ÉÒÔͨ¹ýTRACE FLAG 1204¡¢1205¡¢1206£¬¼ì²éERRORLOGÀïÃæµÄÊä³ö£¬ºÍ·ÖÎöSQLTRACEµÄÖ´ÐÐÉÏÏÂÎÄÅжÏËÀËøÎÊÌâµÄÀ´ÓÉ¡£
--T ......
SELECT * into newtable
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\aaaa.xls";User ID=Admin;Password=;Extended properties=Excel 11.0')...[Sheet1$]
/******* µ¼³öµ½excel
¡¡¡¡exec master..xp_cmdshell 'bcp settledb.dbo.shanghu out c:\temp1.xls -c -q -s"gnetdata/gnetdata" - ......