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

SQL Server×Ô´ø±¸·ÝÕû¸öÊý¾Ý¿â½Å±¾¹¤¾ß scptxfr.exe


Ê×ÏÈÔÚsqlserverµÄ°²×°Â·¾¶Ï£¬È磺D:\Program Files\Microsoft SQL
Server\MSSQL\£¬ÕÒµ½ÎļþÃûÊÇscptxfr.exeµÄÎļþ,ÀûÓÃÃüÁîÐй¤¾ß£º¾ßÌåÓ÷¨ÈçÏ£º
D:\PROGRA~1\MICROS~2\MSSQL\>scptxfr/?
ÃüÁîÐÐÓï·¨:
SCPTXFR /s
<·þÎñÆ÷> /d <Êý¾Ý¿â> {[/I] | [/P <ÃÜÂë>]}
        {[/F
<½Å±¾ÎļþĿ¼>] | [/f <µ¥¸ö½Å±¾Îļþ>]}
        /q /r /O /T /A /E /C
<CodePage> /N /X /H /G /Y /?
/s      —      ָʾҪÁ¬½Óµ½µÄÔ´·þÎñÆ÷¡£
/d      —      ָʾҪΪ֮±àд½Å±¾µÄÔ´Êý¾Ý¿â¡£
/I     
—      ʹÓü¯³É°²È«ÐÔ¡£
/P      —      sa ÒªÓõÄÃÜÂë¡£Çë×¢ÒâµÇ¼ ID ʼÖÕΪ sa¡£
               
Èô/P²»Ê¹Óûò±êÖ¾ºóÃæûÓÐÃÜÂ룬
                Ôò½«Ê¹ÓÿÕÃÜÂë¡£²»Óë /I ¼æÈÝ¡£
/F      —     
½Å±¾ÎļþÓ¦Éú³Éµ½µÄĿ¼¡£
                ÕâÒâζ×ÅΪÿ¸ö¶ÔÏó·ÖÀàÉú³ÉÒ»¸öÎļþ¡£
/f      —     
ËùÓнű¾½«±£´æµ½µÄµ¥¸öÎļþ¡£
                ²»Óë /F ¼æÈÝ¡£
/q      —     
ÔÚËùÉú³ÉµÄ½Å±¾ÖÐʹÓñ»ÒýÓõıêʶ·û¡£
/r      —      Ϊ½Å±¾ÖеĶÔÏó°üÀ¨ drop Óï¾ä¡£
/O     
—      Éú³É OEM ½Å±¾Îļþ¡£ÎÞ·¨ÓÃÓÚ /A »ò /T¡£
                ÕâÊÇĬÈϵÄÐÐΪ


Ïà¹ØÎĵµ£º

SQL Óï¾äÓÅ»¯ hust ei

JOINÓÅ»¯
MySQLÖÐjoinµÄʵÏÖ²ÉÓõÄÊÇNested Loop JoinËã·¨¡£Í¨¹ýÇý¶¯±íµÄ½á¹û¼¯×÷Ϊѭ»·»ù´¡Êý¾Ý£¬È»ºó½«¸Ã½á¹û¼¯ÖеÄÊý¾Ý×÷Ϊ¹ýÂË
Ìõ¼þÒ»ÌõÌõµÄµ½ÏÂÒ»¸ö±íÖвéѯÊý¾Ý£¬×îºóºÏ²¢½á¹û£¬Èç¹û´æÔÚºóÐø±í£¬¹ý³ÌÒ²Èç´Ë¡£
¾¡Á¿¼õÉÙjoinÓï¾äÖÐnested loopÑ­»·µÄ´ÎÊý¡£×îÓÐЧµÄ·½·¨ÊÇÈÃÇý¶¯±íµÄ½á¹û¼¯¾¡¿ÉÄܵÄС
ÓÅÏÈÓÅ»¯nested ......

SQLÖÐ CAST Óë CONVERTת»¯º¯ÊýµÄÓ÷¨

 ½«Ä³ÖÖÊý¾ÝÀàÐ͵ıí´ïʽÏÔʽת»»ÎªÁíÒ»ÖÖÊý¾ÝÀàÐÍ¡£CAST ºÍ CONVERT ÌṩÏàËƵŦÄÜ¡£
Óï·¨
ʹÓà CAST£º
CAST ( expression AS data_type )
ʹÓà CONVERT£º
CONVERT (data_type[(length)], expression [, style])
²ÎÊý
expression
ÊÇÈκÎÓÐЧµÄ Microsoft® SQL Server™ ±í´ïʽ¡£Óйظü¶àÐÅÏ¢£¬Çë² ......

ת£ºsqlÓï¾äʵÏÖ·ÖÒ³»ã×Ü

Ó¦Ò»¸öÅóÓѵÄÒªÇó£¬ÌùÉÏÊղصÄSQL³£Ó÷ÖÒ³µÄ°ì·¨¡«¡«
±íÖÐÖ÷¼ü±ØÐëΪ±êʶÁУ¬[ID] int IDENTITY (1,1)
1.·ÖÒ³·½°¸Ò»£º(ÀûÓÃNot InºÍSELECT TOP·ÖÒ³)
Óï¾äÐÎʽ£º
SELECT TOP Ò³¼Ç¼ÊýÁ¿ *
from ±íÃû
WHERE (ID NOT IN
  (SELECT TOP (ÿҳÐÐÊý*(Ò³Êý-1)) ID
  from ±íÃû
  ORDER BY ID))
  O ......

.netÁ¬½ÓÊý¾Ý¿â£¬Ö´ÐÐsql½Å±¾

1¡¢¶¨ÒåÖ¸Á£ºusing System.Data.SqlClient;
2¡¢¶¨ÒåsqlÁ¬½Ó£º SqlConnection conn= new SqlConnection("server=(local);database=colorring;uid=sa;pwd=;");
3¡¢´ò¿ªsqlÁ¬½Ó£º conn.Open();
4¡¢¶¨ÒåsqlÓï¾ä£ºstring sqlstr = "insert into test values (123321)";
5¡¢×é×°sqlÓï¾äºÍÁ¬½Ó£ºSqlCommand cmd = new SqlCo ......

±ê×¼µÄ SQL µÄ½âÎö˳Ðò

±ê×¼µÄ SQL µÄ½âÎö˳ÐòΪ:
(
1
).
from
×Ó¾ä, ×é×°À´×Ô²»Í¬Êý¾ÝÔ´µÄÊý¾Ý
(
2
).
WHERE
×Ó¾ä, »ùÓÚÖ¸¶¨µÄÌõ¼þ¶Ô¼Ç¼½øÐÐɸѡ
(
3
).
GROUP

BY
×Ó¾ä, ½«Êý¾Ý»®·ÖΪ¶à¸ö·Ö×é
(
4
).ʹÓþۺϺ¯Êý½øÐмÆËã
(
5
).ʹÓÃ
HAVING
×Ó¾äɸѡ·Ö×é
(
6
).¼ÆËãËùÓеıí´ïʽ
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ