Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL×¢Èë·¨¹¥»÷ Ïê½â


Ëæ×ÅB/SģʽӦÓÿª·¢µÄ·¢Õ¹£¬Ê¹ÓÃÕâÖÖģʽ±àдӦÓóÌÐòµÄ³ÌÐòÔ±Ò²Ô½À´Ô½¶à¡£µ«ÊÇÓÉÓÚ³ÌÐòÔ±µÄˮƽ¼°¾­ÑéÒ²²Î²î²»Æ룬Ï൱´óÒ»²¿·Ö³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬Ã»ÓжÔÓû§ÊäÈëÊý¾ÝµÄºÏ·¨ÐÔ½øÐÐÅжϣ¬Ê¹Ó¦ÓóÌÐò´æÔÚ°²È«Òþ»¼¡£Óû§¿ÉÒÔÌá½»Ò»¶ÎÊý¾Ý¿â²éѯ´úÂ룬¸ù
¾Ý³ÌÐò·µ»ØµÄ½á¹û£¬»ñµÃijЩËûÏëµÃÖªµÄÊý¾Ý£¬Õâ¾ÍÊÇËùνµÄSQL Injection£¬¼´SQL×¢Èë¡£
SQL×¢ÈëÊÇ´ÓÕý³£µÄWWW¶Ë¿Ú·ÃÎÊ£¬¶øÇÒ±íÃæ¿´ÆðÀ´¸úÒ»°ãµÄWebÒ³Ãæ·ÃÎÊûʲôÇø±ð£¬ËùÒÔÄ¿Ç°ÊÐÃæµÄ·À»ðǽ¶¼²»»á¶ÔSQL×¢Èë·¢³ö¾¯±¨£¬Èç¹û¹ÜÀíԱû²é¿´IISÈÕÖ¾µÄÏ°¹ß£¬¿ÉÄܱ»ÈëÇֺܳ¤Ê±¼ä¶¼²»»á·¢¾õ¡£µ«ÊÇ£¬SQL×¢ÈëµÄÊÖ·¨Ï൱Áé»î£¬ÔÚ×¢ÈëµÄʱºò»áÅöµ½ºÜ¶àÒâÍâµÄÇé¿ö¡£Äܲ»Äܸù¾Ý¾ßÌåÇé¿ö½øÐзÖÎö£¬¹¹ÔìÇÉÃîµÄSQLÓï¾ä£¬´Ó¶ø³É¹¦»ñÈ¡ÏëÒªµÄÊý¾Ý¡£
¾Ýͳ¼Æ£¬ÍøÕ¾ÓÃASP+Access»òSQLServerµÄÕ¼70%ÒÔÉÏ£¬PHP+MySQÕ¼L20%£¬ÆäËûµÄ²»×ã10%¡£ÔÚ±¾ÎÄ£¬ÒÔSQL-SERVER£«ASPÀý˵Ã÷SQL×¢ÈëµÄÔ­Àí¡¢·½·¨Óë¹ý³Ì¡££¨PHP×¢ÈëµÄÎÄÕÂÓÉNBÁªÃ˵ÄÁíһλÅóÓÑzwell׫дµÄÓйØÎÄÕ£©
SQL×¢Èë¹¥»÷µÄ×ÜÌå˼·ÊÇ£º
l ·¢ÏÖSQL×¢ÈëλÖã»
l ÅжϺǫ́Êý¾Ý¿âÀàÐÍ£»
l È·¶¨XP_CMDSHELL¿ÉÖ´ÐÐÇé¿ö
l ·¢ÏÖWEBÐéÄâĿ¼
l ÉÏ´«ASPľÂí£»
l µÃµ½¹ÜÀíԱȨÏÞ£»
Ò»¡¢SQL×¢È멶´µÄÅжÏ
Ò»°ãÀ´Ëµ£¬SQL×¢ÈëÒ»°ã´æÔÚÓÚÐÎÈ磺HTTP://xxx.xxx.xxx/abc.asp?id=XXµÈ´øÓвÎÊýµÄASP¶¯Ì¬ÍøÒ³ÖУ¬ÓÐʱһ¸ö¶¯Ì¬ÍøÒ³ÖпÉÄÜÖ»ÓÐÒ»¸ö²ÎÊý£¬ÓÐʱ¿ÉÄÜÓÐN¸ö²ÎÊý£¬ÓÐʱÊÇÕûÐͲÎÊý£¬ÓÐʱÊÇ×Ö·û´®ÐͲÎÊý£¬²»ÄÜÒ»¸Å¶øÂÛ¡£×ÜÖ®Ö»ÒªÊÇ´øÓвÎÊýµÄ¶¯Ì¬ÍøÒ³ÇÒ´ËÍøÒ³·ÃÎÊÁËÊý¾Ý¿â£¬ÄÇô¾ÍÓпÉÄÜ´æÔÚSQL×¢Èë¡£Èç¹ûASP³ÌÐòԱûÓа²È«Òâʶ£¬²»½øÐбØÒªµÄ×Ö·û¹ýÂË£¬´æÔÚSQL×¢ÈëµÄ¿ÉÄÜÐԾͷdz£´ó¡£
ΪÁËÈ«ÃæÁ˽⶯̬ÍøÒ³»Ø´ðµÄÐÅÏ¢£¬Ê×Ñ¡Çëµ÷ÕûIEµÄÅäÖᣰÑIE²Ëµ¥-¹¤¾ß-InternetÑ¡Ï¸ß¼¶£­ÏÔʾÓѺÃHTTP´íÎóÐÅϢǰÃæµÄ¹´È¥µô¡£
ΪÁË°ÑÎÊÌâ˵Ã÷Çå³þ£¬ÒÔÏÂÒÔHTTP://xxx.xxx.xxx/abc.asp?p=YYΪÀý½øÐзÖÎö£¬YY¿ÉÄÜÊÇÕûÐÍ£¬Ò²ÓпÉÄÜÊÇ×Ö·û´®¡£
1¡¢ÕûÐͲÎÊýµÄÅжÏ
µ±ÊäÈëµÄ²ÎÊýYYΪÕûÐÍʱ£¬Í¨³£abc.aspÖÐSQLÓï¾äԭò´óÖÂÈçÏ£º
select * from ±íÃû where ×Ö¶Î=YY£¬ËùÒÔ¿ÉÒÔÓÃÒÔϲ½Öè²âÊÔSQL×¢ÈëÊÇ·ñ´æÔÚ¡£
¢ÙHTTP://xxx.xxx.xxx/abc.asp?p=YY’(¸½¼ÓÒ»¸öµ¥ÒýºÅ)£¬´Ëʱabc.ASPÖеÄSQLÓï¾ä±ä³ÉÁË
select * from ±íÃû where ×Ö¶Î=YY’£¬abc.aspÔËÐÐÒì³££»
¢ÚHTTP://xxx.xxx.xxx/abc.asp?p=YY and 1=1, abc.aspÔËÐÐÕý³££¬¶øÇÒÓëHTTP://xxx.xxx.xxx/abc.asp?p=YYÔËÐÐ


Ïà¹ØÎĵµ£º

sqlÓï¾ä µÃµ½ sql server ±íÖÐÁеÄÀàÐͺÍ˵Ã÷

ͨ¹ýSqlÓï¾ä»ñµÃ ÁеÄÀàÐͺÍ˵Ã÷:
  µÃµ½µÄ±íÍ·£º±íÃû|ÁÐÃû|ÀàÐÍ|˵Ã÷
  1£ºÕë¶Ôsql server 2000£¬ÔÚsql2000ÖУ¬Ê¹Óãºsysobjects,syscolumnsºÍsysproperties±í
    SELECT o.name as table_name,c.name AS col_name,type_name(c.xtype) AS type_name,isnull(p.value,'') AS col_Pro ......

±È½ÏÅ£µÄSQL ServerÊé

Microsoft SQL Server2005¼¼ÊõÄÚÄ»:T-SQL³ÌÐòÉè¼Æ
http://www.amazon.cn/mn/detailApp/ref=sr_1_25?_encoding=UTF8&s=books&qid=1261538877&asin=B0011C2568&sr=8-25
Microsoft SQL Server 2005¼¼ÊõÄÚÄ»£º²éѯ¡¢µ÷ÕûºÍÓÅ»¯
http://www.amazon.cn/mn/detailApp/ref=sr_1_4?_encoding=UTF8&s=books&am ......

¡¾Õª¡¿Power Builder Öж¯Ì¬SQLÓï¾äµÄд·¨

PowerBuilderÊÇÄ¿Ç°×îÁ÷ÐеÄÊý¾Ý¿â¿ª·¢¹¤¾ßÖ®Ò»¡£PowerBuilderÌṩÁËÔÚ³ÌÐò´úÂëÖмÓÈëǶÈëʽSQLÓï¾äµÄ¹¦ÄÜÀ´Ö§³Ö¶ÔÊý¾Ý¿âµÄ·ÃÎÊ¡£µ«ÕâÖÖǶÈëʽSQLÓï¾äÖ»ÄÜÖ§³ÖһЩ¹Ì¶¨µÄ±ê×¼µÄSQLÓï¾ä£¬¼´ÔÚ½øÐгÌÐò´úÂë±àÒë´¦ÀíʱÕâЩSQLÓï¾ä±ØÐëÊÇÈ·¶¨µÄ£¬ÀýÈ磺¶ÔÄÄÕűíÄļ¸¸ö×ֶνøÐвÙ×÷ÔÚ³ÌÐò´úÂëÖÐÊǹ̶¨Ð´Ã÷µÄ£¬ÁíÍâÕâÖÖ·½Ê½Ò²²»ÄÜ ......

SQL SERVER ´æ´¢¹ý³Ì¼òµ¥°¸Àý

Ò»¡¢¼òµ¥ÊµÀý
1.Ê×ÏÈÀ´Ò»¸ö×î¼òµ¥µÄ´æ´¢¹ý³Ì°É
CREATE PROCEDURE dbo.testProcedure_AX
AS
select userID from USERS order by userid desc
×¢:dbo.testProcedure_AXÊÇÄã´´½¨µÄ´æ´¢¹ý³ÌÃû,¿ÉÒÔ¸ÄΪ:AXzhzµÈ,±ð¸ú¹Ø¼ü×Ö³åÍ»¾ÍÐÐÁË,ASÏÂÃæ¾ÍÊÇÒ»ÌõSQLÓï¾ä.
2.ÈçºÎÔÚASP.NETÖе÷ÓÃÕâ¸ö´æ´¢¹ý³Ì?
     &n ......

sql group by Óë havingµÄÓ÷¨

1. GROUP BY ÊÇ·Ö×é²éѯ, Ò»°ã GROUP BY ÊǺ;ۺϺ¯ÊýÅäºÏʹÓÃ
group by ÓÐÒ»¸öÔ­Ôò,¾ÍÊÇ select ºóÃæµÄËùÓÐÁÐÖÐ,ûÓÐʹÓþۺϺ¯ÊýµÄÁÐ,±ØÐë³öÏÖÔÚ group by ºóÃ棨ÖØÒª£©
ÀýÈç,ÓÐÈçÏÂÊý¾Ý¿â±í£º
A    B
1    abc
1    bcd
1    asdfg
 Èç¹ûÓÐÈ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ