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

Ò»¶ÎÊä³ö´úÂë±¾ÉíµÄSQL´úÂë


ת×Ôhttp://www.111cn.cn/database/109/b992816b1dddbb641c25c0999883427e.htm
declare @text nvarchar(max);
with tb
as
(
select blocking_session_id,
session_id,db_name(database_id) as dbname,text from master.sys.dm_exec_requests a
CROSS APPLY master.sys.dm_exec_sql_text(a.sql_handle)
),
tb1 as
(
select a.*,login_time,program_name,client_interface_name,login_name,cpu_time,memory_usage*8 as 'memory_usage(KB)',
total_scheduled_time,reads,writes,logical_reads
from tb a inner join master.sys.dm_exec_sessions b
on a.session_id=b.session_id
)
select @text=text from tb1 a inner join master.sys.dm_exec_connections b on a.session_id=b.session_id
print @text
/*
declare @text nvarchar(max);
with tb
as
(
select blocking_session_id,
session_id,db_name(database_id) as dbname,text from master.sys.dm_exec_requests a
CROSS APPLY master.sys.dm_exec_sql_text(a.sql_handle)
),
tb1 as
(
select a.*,login_time,program_name,client_interface_name,login_name,cpu_time,memory_usage*8 as 'memory_usage(KB)',
total_scheduled_time,reads,writes,logical_reads
from tb a inner join master.sys.dm_exec_sessions b
on a.session_id=b.session_id
)
select @text=text from tb1 a inner join master.sys.dm_exec_connections b on a.session_id=b.session_id
print @text
*/
 
»¹¿ÉÒÔ¶ÌÒ»µã£º
declare @text nvarchar(max);
select @text=text
from master.sys.dm_exec_requests a
CROSS APPLY master.sys.dm_exec_sql_text(a.sql_handle)
print @text
/*
declare @text nvarchar(max);
select @text=text
from master.sys.dm_exec_requests a
CROSS APPLY master.sys.dm_exec_sql_text(a.sql_handle)
print @text
*/


Ïà¹ØÎĵµ£º

SQLÓï¾äЧÂÊÎÊÌâµÄ¼¸µã×ܽá

1. SQLÓÅ»¯µÄÔ­ÔòÊÇ£º
  ½«Ò»´Î²Ù×÷ÐèÒª¶ÁÈ¡µÄBLOCKÊý¼õµ½×îµÍ,¼´ÔÚ×î¶ÌµÄʱ¼ä´ïµ½×î´óµÄÊý¾ÝÍÌÍÂÁ¿¡£  
  µ÷Õû²»Á¼SQLͨ³£¿ÉÒÔ´ÓÒÔϼ¸µãÇÐÈ룺  
  ¼ì²é²»Á¼µÄSQL£¬¿¼ÂÇÆäд·¨ÊÇ·ñ»¹ÓпÉÓÅ»¯ÄÚÈÝ  
  ¼ì²é×Ó²éѯ   ¿¼ÂÇSQL×Ó²éѯÊÇ·ñ¿ÉÒÔÓüòµ¥Á¬½Óµ ......

SQLÖÐһЩ¼òµ¥µ«³£ÓõĶ«Î÷»ã×ÜÏÂ


In:µÈÖµÁ¬½Ó£¬ÓÃÀ´²éÕÒ¶à±íÏàͬ×ֶεļǼ
Not In:·ÇµÈÖµÁ¬½Ó£¬ÓÃÀ´²éÕÒ²»´æÔڵļǼ
Inner join:ÄÚÁ¬½Ó£¬Ö÷ÒªÓÃÀ´²éÕÒ¶¼·ûºÏÌõ¼þµÄ¼Ç¼
Left join:×óÁ¬½Ó£¬Ö÷ÒªÓÃÀ´²éÕÒ×ó±ßÓУ¬ÓÒ±ßûÓеÄÓÿÕÖµ±í´ï
Right join:ÓÒÁ¬½Ó£¬Ö÷ÒªÓÃÀ´²éÕÒÓÒ±ßÓУ¬×ó±ßûÓеÄÓÿÕÖµ±í´ï
Order By:ÉýÐò Asc ½µÐò Desc
Group By:·Ö×éÅÅÐò ......

½â¾öASP·ÀSQL×¢Èë¹¥»÷³ÌÐòÎÊÌâ


ÏÖÔڱȽÏÁ÷ÐеÄSQL×¢È빤¾ßµÄ¹¤×÷·½Ê½ÊÇͨ¹ýGETºÍPOSTÀ´Íê³É¾ßÌåµÄ×¢Èë¡£ÎÒÃÇ¿ÉÒÔ½«×¢ÈëʱËùÓõ½µÄÒ»ÇзûºÅ¹ýÂ˵ô¡£ÄÇôÎÒÃÇ¿ÉÒÔͨ¹ý¼òµ¥µÄÅжÏÓï¾äÀ´´ïµ½Ä¿µÄ¡£ÎÒÃÇÏÈÀ´¹ýÂËGET°É¡£
´úÂëÈçÏ£º
dim sql_injdata SQL_inj SQL_Get
SQL_injdata = "’|and|exec|insert|select|delete|update|count|*|%|chr|mid|mast ......

SQL»ù´¡:³£ÓÃSQLÓï¾äÏê½â

µ½½ñÌìΪֹ£¬ÈËÃǶԹØϵÊý¾Ý¿â×öÁË´óÁ¿µÄÑо¿£¬²¢¿ª·¢³ö¹ØϵÊý¾ÝÓïÑÔ£¬Îª²Ù×÷¹ØϵÊý¾Ý¿âÌṩÁË·½±ãµÄÓû§½Ó¿Ú¡£¹ØϵÊý¾ÝÓïÑÔÄ¿Ç°Óм¸Ê®ÖÖ£¬¾ßÓÐÔö¼Ó¡¢É¾³ý¡¢Ð޸ġ¢²éѯ¡¢Êý¾Ý¶¨ÒåÓë¿ØÖƵÈÍêÕûµÄÊý¾Ý¿â²Ù×÷¹¦ÄÜ¡£Í¨³£°ÑËüÃÇ·ÖΪÁ½Àࣺ¹Øϵ´úÊýÀàºÍ¹ØϵÑÝËãÀà¡£  
ÔÚÕâЩÓïÑÔÖУ¬½á¹¹»¯²éѯÓïÑÔSQLÒÔÆäÇ¿´óµÄÊý¾Ý¿â²Ù× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ