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

SQL ·À×¢Èëʽ¹¥»÷

1¡¢¼ì²éÊÇ·ñÓзǷ¨×Ö·û
public static boolean sql_inj(String str)
{
    String inj_str = "'|and|exec|insert|select|delete|update|
count|*|%|chr|mid|master|truncate|char|declare|;|or|-|+|,";
//ÕâÀïµÄ¶«Î÷»¹¿ÉÒÔ×Ô¼ºÌí¼Ó
String[] inj_stra=inj_str.split("\\|");
    for (int i=0 ; i <; inj_stra.length ; i++ )
    {
        if (str.indexOf(inj_stra[i])<=0)
        {
            return true;
        }
    }
    return false;
}
2¡¢¹ýÂË·Ç·¨×Ö·û
public static String TransactSQLInjection(String str)
{
return str.replaceAll(".*([';]+|(--)+).*", " ");
}


Ïà¹ØÎĵµ£º

Êý¾Ý¿âsqlµÄÌØÊâ×Ö·û£º

Êý¾Ý¿âsqlµÄÌØÊâ×Ö·û£º
1£©µ¥ÒýºÅ’£ºÀýÈçstring a = “this is marry’s book.”;
             Ê¹ÓÃinsertʱ¾Í»á³ö´í¡£
             ½â¾ö£ºa= a.Replace("'","' ......

sql serverµÄËæ»úº¯ÊýnewID()ºÍRAND()¡¡¡¡

sql serverµÄËæ»úº¯ÊýnewID()ºÍRAND()¡¡¡¡
¡¡¡¡SELECT * from Northwind..Orders ORDER BY NEWID()
¡¡¡¡--Ëæ»úÅÅÐò
¡¡¡¡SELECT TOP 10 * from Northwind..Orders ORDER BY NEWID()
¡¡¡¡--´ÓOrders±íÖÐËæ»úÈ¡³ö10Ìõ¼Ç¼¡¡¡¡
¡¡¡¡Ê¾Àý¡¡¡¡
¡¡¡¡A.¶Ô±äÁ¿Ê¹Óà NEWID º¯Êý
¡¡¡¡ÒÔÏÂʾÀýʹÓà NEWID() ¶ÔÉùÃ÷Ϊ uniq ......

SQL Server 2005&2008±¸·Ý»Ö¸´×ܽá

 
Ò»¡¢Êý¾Ý¿â´æ´¢¸ÅÊö
1¡¢Êý¾ÝÎļþÀàÐÍ
·         Primary data files:ÿ¸öÊý¾Ý¿â¶¼ÓÐÒ»¸öµ¥¶ÀµÄÖ÷ÒªÊý¾ÝÎļþ£¬Ä¬ÈÏÒÔ.mdfÀ©Õ¹Ãû¡£Ö÷ÒªÊý¾ÝÎļþ²»½ö°üº¬Êý¾ÝÐÅÏ¢£¬»¹°üº¬Óë¸ÃÊý¾Ý¿â½á¹¹Ïà¹ØµÄÐÅÏ¢¡£´´½¨Êý¾Ý¿âʱ£¬Êý¾Ý¿â½á¹¹Ïà¹ØÐÅÏ¢²»½ö´æÔÚÓÚmasterÊý¾Ý¿âÖУ¬Í¬Ê ......

Sql(ÊÂÎï+Óαê)ʹÓ÷½·¨

--µ±Á½¸ö»òÁ½ÒÔÉϵIJÙ×÷Ҫô¶¼Ö´ÐУ¬ÒªÃ´¶¼²»Ö´ÐÐʱҪÓÃÊÂÎñ¡£
1. Sqlд·¨(ÊÂÎï+Óαê)
--¿ªÊ¼ÊÂÎñ
BEGIN TRAN
--²»ÏÔʾ¼ÆÊýÐÅÏ¢
SET NOCOUNT ON
DECLARE @ProjNo varchar(50),@CusNo varchar(50)
--ÉùÃ÷Óαê
DECLARE CRMPSContact_cursor CURSOR FOR 
SEL ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ