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¡£
ÕâÊÇĬÈϵÄÐÐΪ
Ïà¹ØÎĵµ£º
JOINÓÅ»¯
MySQLÖÐjoinµÄʵÏÖ²ÉÓõÄÊÇNested Loop JoinËã·¨¡£Í¨¹ýÇý¶¯±íµÄ½á¹û¼¯×÷Ϊѻ·»ù´¡Êý¾Ý£¬È»ºó½«¸Ã½á¹û¼¯ÖеÄÊý¾Ý×÷Ϊ¹ýÂË
Ìõ¼þÒ»ÌõÌõµÄµ½ÏÂÒ»¸ö±íÖвéѯÊý¾Ý£¬×îºóºÏ²¢½á¹û£¬Èç¹û´æÔÚºóÐø±í£¬¹ý³ÌÒ²Èç´Ë¡£
¾¡Á¿¼õÉÙjoinÓï¾äÖÐnested loopÑ»·µÄ´ÎÊý¡£×îÓÐЧµÄ·½·¨ÊÇÈÃÇý¶¯±íµÄ½á¹û¼¯¾¡¿ÉÄܵÄС
ÓÅÏÈÓÅ»¯nested ......
½«Ä³ÖÖÊý¾ÝÀàÐ͵ıí´ïʽÏÔʽת»»ÎªÁíÒ»ÖÖÊý¾ÝÀàÐÍ¡£CAST ºÍ CONVERT ÌṩÏàËƵŦÄÜ¡£
Óï·¨
ʹÓà CAST£º
CAST ( expression AS data_type )
ʹÓà CONVERT£º
CONVERT (data_type[(length)], expression [, style])
²ÎÊý
expression
ÊÇÈκÎÓÐЧµÄ Microsoft® SQL Server™ ±í´ïʽ¡£Óйظü¶àÐÅÏ¢£¬Çë² ......
Ó¦Ò»¸öÅóÓѵÄÒªÇó£¬ÌùÉÏÊղصÄ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 ......
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 µÄ½âÎö˳ÐòΪ:
(
1
).
from
×Ó¾ä, ×é×°À´×Ô²»Í¬Êý¾ÝÔ´µÄÊý¾Ý
(
2
).
WHERE
×Ó¾ä, »ùÓÚÖ¸¶¨µÄÌõ¼þ¶Ô¼Ç¼½øÐÐɸѡ
(
3
).
GROUP
BY
×Ó¾ä, ½«Êý¾Ý»®·ÖΪ¶à¸ö·Ö×é
(
4
).ʹÓþۺϺ¯Êý½øÐмÆËã
(
5
).ʹÓÃ
HAVING
×Ó¾äɸѡ·Ö×é
(
6
).¼ÆËãËùÓеıí´ïʽ
......