ÀûÓÃÕýÔò±í´ïʽʵÏֵļòµ¥µÄÕûÀíSQLÎı¾µÄС¹¤¾ß
ÏÂÔصØÖ·£º http://download.csdn.net/source/1805903
private string ReArrange(string str)
{
string[] keywords = new string[] {"select","from","where","and","order\\s+by","or","into",
"update","set","delete","haveing","group\\s+by",
"inner\\s+join","left\\s+join","right\\s+join","on",","};
string reg_str1 = "";
string reg_str2 = "";
reg_str1 += "\\s+(?=\\b" + keywords[0] + "\\b)";
reg_str2 += "(?<=\\b" + keywords[0] + "\\b)\\s+";
for (int i = 1; i < keywords.Length; i++)
{
reg_str1 += "|\\s+(?=\\b" + keywords[i] + "\\b)";
reg_str2 += "|(?<=\\b" + keywords[i] + "\\b)\\s+";
}
Regex reg_sel_b = new Regex(reg_str1, RegexOptions.IgnorePatternWhitespace | RegexOptions.IgnoreCase | RegexOptions.Multiline);
Regex reg_sel_a = new Regex(reg_str2, RegexOptions.IgnorePatternWhitespace | RegexOptions.IgnoreCase | RegexOptions.Multiline);
return (reg_sel_a.Replace(reg_sel_b.Replace(str, Environment.NewLine), Environment.NewLine + new string (' ',4) ));
}
Ïà¹ØÎĵµ£º
¶ÔÎÊÌâµÄÀí½âÊǽâ¾öÎÊÌâµÄÇ°Ìᣬ½ñÌìÓöµ½Ò»¸öÏîÄ¿ÖеÄÎÊÌâÈÃÎÒÉî¿ÌµÄÌå»áµ½ÕâÒ»µã¡£
Á½¸ö±í£º
T1
Term Domain WithAncestor
car x.com ?
bike y.com ?
car a.x.com ?
T2
Parent Domain
x.com ......
SQL Server 2000µÄ°²È«ÅäÖÃ
¡¡
¡¡SQL Server 2000µÄ°²È«ÅäÖÃÔÚ½øÐÐSQL Server
2000Êý¾Ý¿âµÄ°²È«ÅäÖÃ֮ǰ£¬Ê×ÏÈÄã±ØÐë¶Ô²Ù×÷ϵͳ½øÐа²È«ÅäÖ㬱£Ö¤ÄãµÄ²Ù×÷ϵͳ´¦ÓÚ°²È«×´Ì¬¡£È»ºó¶ÔÄãҪʹÓõIJÙ×÷Êý¾Ý¿âÈí¼þ£¨³ÌÐò£©½øÐбØÒªµÄ°²
È«ÉóºË£¬±ÈÈç¶ÔASP¡¢PHPµÈ½Å±¾£¬ÕâÊǺܶà»ùÓÚÊý¾Ý¿âµÄWEBÓ¦Óó£³öÏֵݲȫÒþ»¼£ ......
ʹÓÃSQLʱ±ØÐ뿼ÂǵĹؼüÒòËØ
Ò»£¬»ñµÃ½á¹û¼¯ËùÐè·ÃÎʵÄÊý¾ÝÁ¿£¬ÔÚûÓÐÈ·¶¨Ä¿±êÈÝÁ¿Ö®Ç°£¬ºÜÄѶ϶¨²éѯִÐеÄЧÂÊ£»
¶þ£¬¶¨Òå½á¹û¼¯ËùÐèµÄ²éѯÌõ¼þ£¬Ò²¾ÍÊÇÈçºÎÏÞ¶¨½á¹û¼¯£¬ÈçºÎºÏÀíµÄʹÓÃsql×Ӿ䣻
Èý£¬½á¹û¼¯µÄ´óС£¬È¡¾öÓÚ±íµÄ´óСºÍ¹ýÂËÌõ¼þµÄϸ½Ú£¬µ«²»¶¼ÊÇÕâÑù£¬µäÐ͵ÄÇé¿öÊÇ£¬Èô¸É¸ö¶ÀÁ¢Ê¹ÓÃʱЧÂʲ»¸ßµÄÌõ ......
1. >>¼ÓÃÜ
from the Books Online:
Use the WITH ENCRYPTION option:
IF EXISTS (SELECT name from sysobjects
WHERE name = 'encrypt_this' AND type = 'P')
DROP PROCEDURE encrypt_this
GO
USE pubs
GO
CREATE PROCEDURE encrypt_this
WITH ENCRYPTION
AS
SELECT *
from authors
GO
EXEC sp ......
±¾½ÚÖ÷Òª½éÉÜʹÓÃCLR´´½¨±êÁ¿º¯Êý£¬±íÖµº¯ÊýºÍ¾ÛºÏº¯Êý¡£
Ëùν±êÁ¿º¯ÊýÖ¸µÄ¾ÍÊǴ˺¯ÊýÖ»·µ»ØÒ»¸öÖµ¡£±íÖµº¯Êý·µ»ØÖµÊÇÒ»¸ö±í¡£¾ÛºÏº¯ÊýÊÇÔÚselectÓï¾äÖÐʹÓõģ¬ÓÃÀ´¾ÛºÏÒ»¸ö½á¹û¼¯£¬ÀàËÆÓÚSum()»òÊÇCount()µÈÄÚÖõĺ¯Êý£¬¶øÇÒÕæÕýµÄ×Ô¶¨Òå¾ÛºÏº¯ÊýÄ¿Ç°Ö»ÄÜÓÃCLRÀ´ÊµÏÖ¡£
ÏÂÃæµÄÀý×ÓʹÓÃÁËSQLServer×Ô´øµÄpubsÊý¾Ý¿â¡£
1 ......