Ò³Ãæ´«ÖµÑéÖ¤(·ÀSQL×¢Èë)
Global.asaxÎļþÖÐ
ÔÚÒ³ÃæÌø×ªÊ±£¬·ÀÖ¹´«ÖµµÄ²ÎÊýÖÐSQL×¢È룺
void Application_BeginRequest(object sender, EventArgs e)
{
ProcessRequest();
}
void ProcessRequest()
{
try
{
if (HttpContext.Current.Request.Form.Count > 0)
{
NameValueCollection collection = HttpContext.Current.Request.Form;
foreach (string strKeys in collection.AllKeys)
{
if (strKeys == "__VIEWSTATE")
{
continue;
}
else
{
if (!CheckRequest(collection.Get(strKeys)))
{
System.Web.HttpContext.Current.Response.End();
}
}
}
}
&nbs
Ïà¹ØÎĵµ£º
ÈçºÎ¿ªÆôSQL CLR
¿ªÆôSQL CLRÓÐÁ½²½²Ù×÷£¬ÈçÏÂËùʾ£º
1. ¿ªÆôSQLCLR£¬ÔÚsql server2005ÖÐÖ´ÐÐÈçϽű¾£¬¿ªÆôSQL CLR¹¦ÄÜ
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
-- Tu ......
º¯Êý
SQLServerºÍOracleµÄ³£Óú¯Êý¶Ô±È
¡¡¡¡1.¾ø¶ÔÖµ
¡¡¡¡S:select abs(-1) value
¡¡¡¡O:select abs(-1) value from dual
¡¡¡¡2.È¡Õû(´ó)
¡¡¡¡S:select ceiling(-1.001) value
¡¡¡¡O:select ceil(-1.001) value from dual
¡¡¡¡3.È¡Õû£¨Ð¡£©
¡¡¡¡S:select floor(-1.001) value
¡¡¡¡O:select floor(-1.001 ......
1¡¢°´Äê²éѯ£ºselect * from dbo.td_BBSBoardInfo where (year(BBI_DateTime) between 2006 and 2009)
°´Ô¡¢ÈÕ²éѯֻҪ½«year ¸ÄΪ month¡¢data
2¡¢°´ÄêÔ²éѯ£ºselect * from dbo.td_BBSBoardInfo where convert(varchar(6),BBI_DateTime,112) between 200606 and 200911 ......
1 ǰÑÔ
¿Í·þÒµÎñÊܵ½SQLÓï¾äµÄÓ°Ïì·Ç³£´ó£¬ÔÚ¹æÄ£±È½Ï´óµÄ¾Öµã£¬ÍùÍùÒòΪһ¸öСµÄSQLÓï¾ä²»¹»ÓÅ»¯£¬µ¼ÖÂÊý¾Ý¿âÐÔÄܼ±¾çϽµ£¬Ð¡ÐÍ»úidleËùÊ£ÎÞ¼¸£¬Ó¦Ó÷þÎñÆ÷¶ÏÁ¬¡¢³¬Ê±£¬ÑÏÖØÓ°ÏìÒµÎñµÄÕý³£ÔËÐС£Òò´Ë£¬³ÆµÍЧµÄSQLÓï¾äΪ¿Í·þÒµÎñµÄ‘¶ñÁú’²¢²»¹ý·Ö¡£Êý¾Ý¿âµ ......
1.²éѯ³öµ±Ç°Á¬½ÓÈ»ºó½«Æä¹Ø±Õ
select spid
from master.dbo.sysprocesses
where dbid= db_id('Êý¾Ý¿âÃû')
--db_id('DoNet')
Èçspid ֵΪ 52.
2. 執ÐÐ:
kill 52
3.ÐÞ¸Ä數據庫Ãû
EXEC sp_dboption 'old_db_name', 'Single User', 'false'
&nb ......