Excelµ¼Èëµ½SQLµÄÒ»¸öÐÂ˼·
/*
±ÈÈçExcelÓÐÁ½ÁУ¬AÁкÍBÁÐÐèÒªµ¼Èëµ½SQL±íÖУ¬·´ÕýÎÒÒѾÓм¸Äê²»ÓÃDTSÖ®ÀàµÄ¹¤¾ßÁË¡£
ÔÚExcelÖеÄеÄÒ»ÁÐÖУ¬Ö±½Óд¹«Ê½
=CONCATENATE("Insert #tmp values('",A1,"','",B1,"')")
°ÑÿһÐж¼Éè³ÉͬÑùµÄ¹«Ê½(Ë«»÷¼´¿ÉÍê³É)¡£
°ÑÕûÁи´ÖÆÏÂÀ´£¬·Åµ½²éѯ·ÖÎöÆ÷ÖÐÖ±½ÓÔËÐоͺÃÁË¡£
Ò²¿ÉÒ԰ѹ«Ê½¸Ä³É =CONCATENATE("select '",A1,"','",B1,"' Union all")
ÕâÑùµÄºÃ´¦¶à
1: ²»ÓùÜÄãʲô¸ñʽ£¬¾ø¶Ô²»»áÂÒ¡£
2£º¿ì½Ý·½±ã£¨ÁÐÊý²»Ì«¶àµÄ»°Ò»°ãÒ»·ÖÖÓÖ®ÄÚ¿ÉÒԸ㶨£©
3: ²»»á³ö´í£¬ÉõÖÁ¶¼²»ÐèÒªºË¶Ô¡£
......
*/
ת×Ô£ºhttp://topic.csdn.net/u/20091020/08/2162e737-577f-4f0c-9a4c-592ba97c698c.html?seed=1969593865&r=60535884#r_60535884
Ïà¹ØÎĵµ£º
Èç¹ûÄã¾³£Óöµ½ÏÂÃæµÄÎÊÌ⣬Äã¾ÍÒª¿¼ÂÇʹÓÃSQL ServerµÄÄ£°åÀ´Ð´¹æ·¶µÄSQLÓï¾äÁË£º
SQL³õѧÕß¡£
¾³£Íü¼Ç³£ÓõÄDML»òÊÇDDL SQL Óï¾ä¡£
ÔÚ¶àÈË¿ª·¢Î¬»¤µÄSQLÖУ¬Ã¿¸öÈ˶¼ÓÐ×Ô¼ºµÄSQLÏ°¹ß£¬Ã»ÓÐÒ»Ì×ͳһµÄ¹æ·¶¡£
ÔÚSQL Server Management StudioÖУ¬ÒѾ¸ø´ó¼ÒÌṩÁ˺ܶೣÓõÄÏÖ³ÉSQL¹æ·¶Ä£°å¡£
SQL Server Management ......
1¡¢¾µäµÄ²éѯÓï¾ä
2¡¢¾µäµÄ×Ö¶¨Ò庯Êý
3¡¢¾µäµÄÓëÒµÎñÏà¹ØµÄ´æ´¢¹ý³Ì
µÈµÈ
1¡¢ ¸ú×Ùµ±Ç°¶Ô»°ÏÂÓû§µÄSQL½Å±¾
select sql_text from v$sqltext_with_newlines where (hash_value,address)
in (select sql_hash_value,sql_address from v$session where sid=&sid)
order by address,piece;
SID
ÓÉÕâ ......
ÎÒÃÇÒª×öµ½²»µ«»áдSQL,»¹Òª×öµ½Ð´³öÐÔÄÜÓÅÁ¼µÄSQL,ÒÔÏÂΪ±ÊÕßѧϰ¡¢ÕªÂ¼¡¢²¢»ã×ܲ¿·Ö×ÊÁÏÓë´ó¼Ò·ÖÏí£¡
£¨1£© Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
ORACLEµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí£ ......
ËäȻֱ½Ó½«ÎļþÄÚÈÝ´æÈëÊý¾Ý¿â×ֶεÄÇé¿ö²»¶à£¬²»¹ýÔÚ¶ÔÓÚÎļþÄÚÈݻᷢÉú±ä»¯µÄÇé¿öÏ´æÈëÊý¾Ý¿â×Ö¶ÎÒ²²»Ê§ÎªÒ»ÖÖ·½·¨¡£
Æäʵ·½·¨ºÜ¼òµ¥£¬ÕâÀïÓõ½Ò»¸öload_fileº¯Êý£¬²»ÖªµÀÊDz»ÊÇÎÒϵÄMYSQLÊÖ²áÓÐÎÊÌâ¡£ÎÒÔÚÕÒÕâ¸öº¯ÊýµÄʱºòË÷ÒýºÍÄÚÈݲ»¶ÔÓ¦¡£
Ê×ÏÈÊǽ¨±íÓï¾ä
create table test (id int,file blob);
²åÈëÓï¾ ......
н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default 'ĬÈÏÖµ' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [±í ......