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

C#.NET·ÀÖ¹SQL×¢Èëʽ¹¥»÷

1  ·ÀÖ¹sql×¢Èëʽ¹¥»÷(¿ÉÓÃÓÚUI²ã¿ØÖÆ£© #region  ·ÀÖ¹sql×¢Èëʽ¹¥»÷(¿ÉÓÃÓÚUI²ã¿ØÖÆ£©
  2 
  3   /**/ /// 
  4  ///  ÅжÏ×Ö·û´®ÖÐÊÇ·ñÓÐSQL¹¥»÷´úÂë
  5  /// 
  6  ///  ´«ÈëÓû§Ìá½»Êý¾Ý
  7  ///  true-°²È«£»false-ÓÐ×¢Èë¹¥»÷ÏÖÓУ»
  8  public   bool  ProcessSqlStr( string  inputString)
  9    {
 10       string  SqlStr  =   @" and|or|exec|execute|insert|select|delete|update|alter|create|drop|count|\*|chr|char|asc|mid|substring|master|truncate|declare|xp_cmdshell|restore|backup|net +user|net +localgroup +administrators " ;
 11       try
 12         {
 13           if  ((inputString  !=   null )  &&  (inputString  !=  String.Empty))
 14             {
 15               string  str_Regex  =   @" \b( "   +  SqlStr  +   @" )\b " ;
 16 
 17              Regex Regex  =   new  Regex(str_Regex, RegexOptions.IgnoreCase);
 18               // string s = Regex.Match(inputString).Value; 
 19               if  ( true   ==  Regex.IsMatch(inputString))
 20                   return   false ;
 21 
 22 &


Ïà¹ØÎĵµ£º

SQL Êý¾ÝÀàÐÍ


Microsoft Access Êý¾ÝÀàÐÍ
Êý¾ÝÀàÐÍ
ÃèÊö
´æ´¢
Text
ÓÃÓÚÎı¾»òÎı¾ÓëÊý×ÖµÄ×éºÏ¡£×î¶à 255 ¸ö×Ö·û¡£
 
Memo
Memo ÓÃÓÚ¸ü´óÊýÁ¿µÄÎı¾¡£×î¶à´æ´¢ 65,536 ¸ö×Ö·û¡£
×¢ÊÍ£ºÎÞ·¨¶Ô memo ×ֶνøÐÐÅÅÐò¡£²»¹ýËüÃÇÊÇ¿ÉËÑË÷µÄ¡£
 
Byte
ÔÊÐí 0 µ½ 255 µÄÊý×Ö¡£
1 ×Ö½Ú
Integer
ÔÊÐí½éÓÚ -32,768 µ½ 32 ......

MS SQL ServerºÍMySQLÇø±ð

      1 MySQLÖ§³Öenum,ºÍsetÀàÐÍ£¬SQL Server²»Ö§³Ö
¡¡¡¡2 MySQL²»Ö§³Önchar,nvarchar,ntextÀàÐÍ
¡¡¡¡3 MySQLµÄµÝÔöÓï¾äÊÇAUTO_INCREMENT£¬¶øMS SQLÊÇidentity(1,1)
¡¡¡¡4 MS SQLĬÈϵ½´¦±í´´½¨Óï¾äµÄĬÈÏÖµ±íʾÊÇ((0)),¶øÔÚMySQLÀïÃæÊDz»ÔÊÐí´øÁ½À¨ºÅµÄ
¡¡¡¡5 MySQLÐèҪΪ±íÖ¸¶¨´æ´¢ÀàÐÍ
¡ ......

×î½üµÄÁ½ÌõsqlЧÂÊÓÅ»¯ÐĵÃ

µÚÒ»Ìõ£º
select * from where field in (1,2,3)   ÕâÖÖд·¨Ó¦¸ÃÉáÆúÁË£¬¶øÓ¦¸ÃÕâÑùд£º
select * from table where field = 1 or field = 2 or field = 3 
ΪʲôÄØ£¿
·²ÊÂÖ»ÓÐ×ö¹ý²ÅÖªµÀ£¬×Ô¼º½¨¸ö±í£¬²åÈë10WÌõ²âÊÔÊý¾Ý£¬ÓÃsql²âÊÔһϱãÖª£¬ÒòΪ¹¤×÷±ãÀû£¬ÎÒÔÚ²úÆ·»úºÍÍâÍø²âÊÔ»ú¶¼ÒѾ­²âÊÔ¹ý£ ......

oracle sql ÇóÖÖ²Ëʱ¼ä

-- create by zh
-- n ÊÇ×÷ÎïµÄʱ¼ä,x ÊÇÏ£ÍûÔÚ¼¸µã³ÉÊì,·µ»Ø²¥ÖÖµÄʱ¼ä
with t as
(
select 64 n,9 x from dual union all
select 64 n,13 x from dual union all
select 64 n,17 x from dual union all
select 64 n,20 x from dual
)
select '³ÉÊìʱ¼ä:'     || lpad(to_char(n),4,' ' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ