???????? ?? Microsoft SQL Server 2005: T-SQL "?? ????????? ??" ????????? ?????????? ?????????

?????? ????????? ?????? ?????????
???? ???????: 920141 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

????? ??? ??????? ??? ??????? ????????? ???????? ??? ????? ???????? ???????? ???? Microsoft Press ???? Microsoft SQL Server 2005: T-SQL "?? ????????? ??" ? 0-7356-2313-9.

??? ????? ???????? ???????:

  • 8 ??????: ????? ???????? ??????
  • 20 ????: ??????? ????? ?? ??????? <right_table_expression> ??????? <table_expression>
  • 43 ??????: ??? ?????? ?? ????? 2-7.
  • ???? 51: ?????? ?? ???? MoreInfo ??? ????
  • 68 ??????: ????? ?? ?? ????? ????????? ????????
  • 73 ??????: ??? ?? ???? "signal_wait_time" "signal_wait_time_ms"
  • 81 ??????: ?????? ?? ???? 3-3 ?????
  • 101 ??????: "1000" ????????? ???? "1000000"
  • 102 ????? 103: "1000" ????????? ???? "1000000"
  • 137 ??????: ??? ?????? ????? ????? ?? ????? ??? ????? ????????
  • 139 ??????: "??? ???????" ??? "???????"
  • 140 ??????: ??? ?? ???? orderid ?????? 120 ?? ?????? ?????? ?? ?????? ??????? ?????????
  • 141 ??????: ???? ?????? ?????? ????? ????? ?? "????? ?? ??????"
  • 158 ??????: ????? ?????? "????? ??? ????" ????? ?? ??????? "???? ???"
  • 162 ??????: ?? ?????? ?? ?????? ???????? ???? ????? orderdate ??????? orderid
  • ????? 163-166: ??? ????? Nonclustered ?????? ?????? ????? ????? "??? ????? ???? Nonclustered ?????? ??????"
  • 168 ??????: "?????? ???????"??? ?? ????"???? ?????"
  • 173 ??????: ??????? ??????? ?????? ????? ????? ?? ??????? ???? ?????
  • 173 ??????: ????? ??? ???? 3-7 ??? ?? ???? ????? ?? ????? ????? BigSessions
  • ??? ?? ???? "???" 187 ??????: "??"
  • 192 ??????: ????? ?? ??????? ?????? ????????? ?????? ???? ??????
  • 203 ??????: ????? b ?????? ????? ????? ?? c ?????
  • ???? 203: ??? ?? ???? "EXISTS" "NOT EXISTS"
  • ???? 206: "MIN(keycol) + 1" ??? ?? ???? "MIN(keycol + 1)"
  • 272 ??????: "????? ???????" ? "??????????? ???????" ?????? ????? ????? ?? "??????" ? "UNPIVOT"
  • 328 ??????: "???????" ??? ?? ???? "?????"
  • 340 ??????: refered ????? ?????? ??? ????? ?? "????? ??????" ?? ??????? ????????? ?? ???? 6-16.
  • 356 ??????: ???? ???????? ?? ?????
  • 360 ??????: ??????? ??? ????
  • 364 ??????: ?????? ??????? ?????? ??????? ?? ???? 6-24 ??? ????
  • 364 ??????: ?????? ??????? ?????? ??????? ?? ???? 6-25 ??? ????
  • ???? 412: "2147483648" ??? ?? ???? "-2147483648"
  • ????? 431 ? 432: #CustStage ??????? ??? ????? ?? #CustsStage
  • 434 ??????: refered usp_AsyncSec ??? ????? ?? usp_AsyncSeq
  • 445 ??????: ???? SET ??? ???? ?? ????? ????????? ???????? ?????
  • ??? 445 ??????: "????" ?? ???? "????"
  • 480 ??????: ??? ??????? ????? ????? ?? fn_subordinates1 fn_subordinates2
  • 485 ??????: < ??? ?? ???? < =
  • 493 ??????: ??? ?? ???? "SubsPath" "SubsSort"
  • 494 ??????: ??? ?? ???? @ #
  • 506 ??????: ??????? ??? ???? ????? ?????? ??????
  • 513 ??????: ??? ?? ???? ?????? ??? ???? 9-35 ???? ???????
  • 533 ??????: ??? ?? ???? "BOMCTE" "BOMTC"
  • 562 ??????: ????? 36 ????? ?? ????? ????? ???????? ???
  • 567 ??????: Corretion ??? ???????? ??????? 19

??????? ????

8 ??????: ????? ???????? ??????

?? ?????? 8, ?? ????? ?????? ?? ?????? ??????? "? ???? ???.

?????:

? ????? ?????? ?????? ???? ???? ? PRIMARY KEY ????? ???????? ?????? NULLs ??? ?????: ??? ?? ???? ????? ?? ???? ???? ?? ????? ?? ???? ???? ????? ??? ??? ???? ?? PRIMARY KEY ????? ????. ?

???:

? ??? ?????? ??????, ??? UNIQUE ????? ???????? ??????? ?????? ??????? ??? ???? ????? ?????: ??? ?? ???? ????? ?? ???? ???? ?? ????? ?? ???? ???? ????? ??? ??? UNIQUE ????? ????. ?

20 ????: ??????? ????? ?? ??????? <right_table_expression> ??????? <table_expression>

?? ?????? 20 ? ???? ????? ?????? ?? ???? ????? ?????? ??????:

{CROSS | OUTER} APPLY <table_expression>


??? ?????:

{CROSS | OUTER} APPLY <right_table_expression>


43 ??????: ??? ?????? ?? ????? 2-7.

?? ?????? 43, ?? ????? 2-7 ? ??? ?? ???? ???? "???" ????? ???? ????? ?? "????????? ????? ????? ?????? ?" ??? "???? ?????? ??????? 1".

???? 51: ?????? ?? ???? MoreInfo ??? ????

??? ???? 51 ?????? ????? ???? ???? MoreInfo ????? ??? ?????? ???? ????? ??? ?????.

?????:
"???? ?????? ??? ???? ??? ??????? ???????? ?? showplan XML ?? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/xmlshowplans.asp."

???:
"???? ?????? ??? ???? ??? ??????? ???????? ?? showplan XML ?? http://msdn2.microsoft.com/en-us/library/ms345130.aspx."

68 ??????: ????? ?? ?? ????? ????????? ????????

?? ?????? 68 ? ???? 35 32 ???? ?? ????? ????????? ????????:

- CASE WHEN n % 10 = 0
	THEN THEN 1 + ABS(CHECKSUM(NEWID())) % 30
	ELSE 0
  END AS orderdate

??? ?????:

- CASE WHEN n % 10 = 0
	THEN 1 + ABS(CHECKSUM(NEWID())) % 30
	ELSE 0
  END AS orderdate


73 ??????: ??? ?? ???? "signal_wait_time" "signal_wait_time_ms"

?? ?????? 73 ?????? ??????? ??? ?????? ????? ??? wait_time ??? ?????.

?????:
"sys.dm_os_wait_stats DMV ????? ??? ?????? ???????: wait_type ???????? waiting_tasks_count ??? ?????? ??? ??? ?????; ???????? wait_time_ms ?????? ??? ???? ????? ???????? ?? ???? ????? (??? ?? ??? signal_wait_time)"; "max_wait_time_ms;" ? "signal_wait_time ????? ??? ??? ?? ??????? ???? ??????? ??? ???????? ? ??? ??? ????? ??? ???????."

???:
"sys.dm_os_wait_stats DMV ????? ??? ?????? ???????: wait_type ???????? waiting_tasks_count ??? ?????? ??? ??? ?????; ???????? wait_time_ms ?????? ??? ???? ????? ???????? ?? ???? ????? (??? ?? ??? signal_wait_time)"; "max_wait_time_ms;" ? "signal_wait_time_ms ????? ??? ??? ?? ??????? ???? ??????? ??? ???????? ? ??? ??? ????? ??? ???????."

81 ??????: ?????? ?? ???? 3-3 ?????

?? ?????? 81 ????? ??????? ???????? ?? ?????? "counter_name":

"Buffercachehitratio
?????? ?????? ????? ??? ???? ?????? ??? ???? ??? ????? ??????? ??????
Pagelookups/???????
Freeliststalls/???????
Freepages
Totalpages
Targetpages
Databasepages
Reservedpages
Stolenpages"

??? ????? ???:

"?????? ?????? ????? ??????? ?????? ??? ???? ?????? ??? ????
?????? ?????? ????? ??? ???? ?????? ??? ???? ??? ????? ??????? ??????
??? ?????? ????? ???????/???????
?????? ???????? ??????? ????? ???????
??????? ?????
?????? ???????
??????? ?????
????? ????? ????????
????? ?????
??????? ?????"

101 ??????: "1000" ????????? ???? "1000000"

?? ?????? 101 ? ???? ????? ?????? ??????? ?? ????? ???????? ????????:

CAST(AQ1.total_duration / 1000.

CAST(SUM(AQ2.total_duration) / 1000.

??? ?????:

CAST(AQ1.total_duration / 100000.

CAST(SUM(AQ2.total_duration) / 100000.


102 ????? 103: "1000" ????????? ???? "1000000"

??? ????? 102 ? 103 ????? ????? ?????? ? ?????? ?? ????????? ???????? ???????:

CAST(AQ1.total_duration / 1000.

CAST(SUM(AQ2.total_duration) / 1000.

??? ?????:

CAST(AQ1.total_duration / 100000.

CAST(SUM(AQ2.total_duration) / 100000.


137 ??????: ??? ?????? ????? ????? ?? ????? ??? ????? ????????

?? ?????? 137 ? ???? ?????? ?????? ?? ??????:

"?? ?? ??????? ?? ???? ?????? ????? ??????? ???? ??? ?? ???? ???? ?????? ?? ???? ????? ??????? ??? ?????? ??? ????? ????? ???????? ?????? ?????? ???????."

??? ?????:

"?? ?? ??????? ?? ???? ?????? ????? ??????? ???? ??? ?? ???? ???? ?????? ?? ???? ????? ??? ????? ??? ?????? ??? ????? ????? ???????? ?????? ?????? ???????."

139 ??????: "??? ???????" ??? "???????"

?? ?????? 139 ?????? ?????? ??? ?????? ??????? "??? ???????" ???? ???????.

?????:
"?? ??? ???????? ??? ???? ???? ??? ??? ??? ?????? ?? ????? ???? ????; ????? ?? ???? ????? ???????? ????? ?????? ????? ???? ?? ?????? ?? ?????? ??????? ???????."

???:
"??? ??????? ??? ???? ???? ???? ??? ??? ??? ?????? ?? ????? ???? ????; ????? ?? ???? ????? ???????? ????? ?????? ????? ???? ?? ?????? ?? ?????? ??????? ???????."

140 ??????: ??? ?? ???? orderid 120 ?? ?????? ?????? ?? ?????? ??????? ?????????

?? ?????? 140, ?? ?????? ??????? ?????????? ???? ?????? 6:

"????? ?????? ?? ????? ?????? ??? ????? ????? ?? ????? ????? ?? ????? ?????? ?? ?????? ??? ??? (orderid = 101)."

??? ?????:

"????? ?????? ?? ????? ?????? ??? ????? ????? ?? ????? ????? ?? ????? ?????? ?? ?????? ??? ??? (orderid = 120)."

141 ??????: ???? ?????? ?????? ????? ????? ?? "????? ?? ??????"

?? ?????? 141 ? ???? ?????? ????? ?? ?????? ???????:

"?? ???? ???? ???? ???????? ???? ?? ??????? ??????? ???? ??? ???? ???? ?? ????? ??????; ????? ?? ???? ????? ?? ???? ????? ?????? ??????".

??? ?????:

"?? ???? ???? ???? ???????? ???? ?? ??????? ??????? ???? ??? ???? ???? ?? ????? ??????; ????? ?? ???? ????? ??" ???? ????? ?? "???? ???????".

158 ??????: ????? ?????? "????? ??? ????" ????? ?? ??????? "???? ???"

?? ?????? 158 ?????? ?????? ?? ?????? ??? ????? ??? 3 49 ????:

"???? ???? selectivity ????????? ?????? ???? ??????? ?????? ????? ???."

??? ?????:

"??? ???? selectivity ????????? ??? (?????? selectivity = ???? ????? ?? ??????) ?? ??????? ?????? ?? ?????? ????? ???."

162 ??????: ?? ?????? ?? ?????? ???????? ???? ????? orderdate ??????? orderid

?? ?????? 162 ? ???? ????? ?????? ?? ??????:

"CREATE INDEX ??????? ???????? UNIQUE idx_cl_od ON dbo.Orders(orderid);"

??? ?????:

"CREATE INDEX ??????? ???????? idx_cl_od ON dbo.Orders(orderdate);"

????? 163-166: ??? ????? Nonclustered ?????? ?????? ????? ????? "??? ????? ???? Nonclustered ?????? ??????"

?? ?????? 163 ????? ?????? ?????? ?? ?????? ?????? ??????? ?? ???? 3-16:

"????? ???? Nonclustered ???? ??????

????? ???? ???? ?????? Nonclustered + ???????"

??? ????? ???:

"??? ????? Nonclustered ?????? ?????

???? ?????? Nonclustered ??? ????? + ???????"

?? ?????? 164 ????? ??????? ??????? ???????? ??? ?????? ?????? ?? ??????? ?????? ??? ????? 3-55:

"????? ???? Nonclustered ???? ??????

????? ???? ???? ?????? Nonclustered + ???????"

??? ????? ???:

"??? ????? Nonclustered ?????? ?????

???? ?????? Nonclustered ??? ????? + ???????"

?? ?????? 164 ????? ?????? ?????? ?? ?????? ?????? ??????? ?? ???? 3-17:

"????? ???? Nonclustered ???? ??????

????? ???? ???? ?????? Nonclustered + ???????"

??? ????? ???:

"??? ????? Nonclustered ?????? ?????

???? ?????? Nonclustered ??? ????? + ???????"

?? ?????? 165 ????? ??????? ??????? ???????? ??? ?????? ?????? ?? ??????? ?????? ??? ????? 3-56:

"????? ???? Nonclustered ???? ??????

????? ???? ???? ?????? Nonclustered + ???????"

??? ????? ???:

"??? ????? Nonclustered ?????? ?????

???? ?????? Nonclustered ??? ????? + ???????"

?? ?????? 166 ????? ???????? ?????? ?????? ?????? ??????? ?? ????? 3-57:

"????? ???? Nonclustered ???? ??????

????? ???? ???? ?????? Nonclustered + ???????"

??? ????? ???:

"??? ????? Nonclustered ?????? ?????

???? ?????? Nonclustered ??? ????? + ???????"

168 ??????: "?????? ???????"??? ?? ????"???? ?????"

?? ?????? 168 ?????? ?????? ?? ?????? ?????? ????? ??? ???? ??? ????? ??? "?????? ?????".

?????:
"????? ????? ???????? ??????? ????? ??? ??? ? ???? ???? ????? ?? ?????? ?????."

???:
"????? ????? ???????? ??????? ????? ??? ??? ? ????? ???? ????? ?? ?????? ?????."

173 ??????: ??????? ??????? ?????? ????? ????? ?? ??????? ???? ?????

?? ?????? 173 ? ???? ?????? ?????? ?? ?????? ??????:

"????? ?????? ???? ??? ?? ???? ??????? ??? ??????? ??? ?????? ????? ?????? ?????."

??? ?????:

"????? ?????? ???? ??? ?? ???? ???? ??? ????? ?????? ????? ??? ???? ??? ??? ???? ????? ?????."

173 ??????: ????? ??? ???? 3-7 ??? ?? ???? ????? ?? ????? ????? BigSessions

?? ?????? 173 ??????? ????????? ????? ??????? 3-7:

"????? ????? ????? ?? ?????? ????? ??? ?????"

??? ?????:

"????? BigSessions ?? ?????? ????? ??? ?????"

??? ?? ???? "???" 187 ??????: "??"

?? ?????? 187 ?????? ?????? ??? ????? 3-66 ????? ??? ???? ??? ?????.

?????:
"??? ???? ??????? ??? ? ??? ????? ????? ??????? ????? ???? ?????? ?? ??? ??? ????? ????? ?? ????."

???:
"??? ???? ??????? ?? ? ??? ????? ??? ??????? ??????? ????? ???? ?????? ?? ??? ??? ????? ????? ?? ????."

192 ??????: ????? ?? ??????? ?????? ????????? ?????? ???? ??????

?? ?????? 192 ? ???? ????????? ?????? ????????? ?????? ???? ??????:

"????? ????????? ???????? ??????? ???? ???? ??? ???? ??????: ??? ????? ??? ?? ???? ??? ????? ?? N?Kollar LIKE ? ????? ?? N?Davolio LIKE ? ? ? ??? ???? ?? N LIKE ' ? %:"

??? ?????:

"????? ????????? ???????? ??????? ???? ???? ??? ???? ??????: ??? ????? ??? ?? ???? ??? ????? ?? N?Kollar LIKE ? ????? ?? N?Davolio LIKE ? ? ? ??? ???? ?? N LIKE ' ? ' % ':"

203 ??????: ????? b ?????? ????? ????? ?? c ?????

?? ?????? 203 ? ???? ?????? ?????? ?? ??????:

"???? ??????? b IN(a, b, NULL) NOT ???????? ????? ??? ????? ????? ????? ? c ??????? ?? ???? ?? ????????? ??? ? ??? ????? ?? ?? c ?? ???? ?? ????? ???????."

??? ?????:

"c ???? ??????? IN(a, b, NULL) NOT ???????? ????? ??? ????? ????? ????? ? c ??????? ?? ???? ?? ????????? ??? ? ??? ????? ?? ?? c ?? ???? ?? ????? ???????."

???? 203: ??? ?? ???? "EXISTS" "NOT EXISTS"

?? ?????? 203 ?????? ??????? ?? ?????? ?????? ????? ??? ??????? ??? ?????.

?????:
"?????? ??????? NOT IN ???? ????? ??? ?????? ?? query EXISTS ?????? ?????? ??? ????? (??? ??? ???????) ?? ????? ??? ????? ????? ??? ??????? ???? ???????? ?????? ???????:"

???:
"?????? ??????? NOT IN ???? ????? ??? ?????? ?? query NOT EXISTS ?????? ?????? ??? ????? (??? ??? ???????) ?? ????? ??? ????? ????? ??? ??????? ???? ???????? ?????? ???????:"

???? 206: "MIN(keycol) + 1" ??? ?? ???? "MIN(keycol + 1)"

?? ?????? 206 ?????? ?????? ?? ?????? ?????? ????? ??? ????? ??? ????.

?????:
"??? ?? ?????? 1 ?? ?????? (??? ?????? EXISTS ?????? ????? FALSE) ? ?????? ???? ??????? ?????? ????? ? ??????? MIN(keycol) + 1 ???? ?????."

???:
"??? ?? ?????? 1 ?? ?????? (??? ?????? EXISTS ?????? ????? FALSE) ? ?????? ???? ??????? ?????? ????? ? ??????? MIN(keycol + 1) ???? ?????."

272 ??????: "????? ???????" ? "??????????? ???????" ?????? ????? ????? ?? "??????" ? "UNPIVOT"

?? ?????? 272 ? ???? ?????? ????? ?? ???????? ?? ???? ??????:

"????? ??? ??????? ?? ????? ?????? ??? ????? ???? ??? ????? ?? ??????? ????? ??? ????? (??? ???? ??????? ??????? ????? ? ??????????? ??????? ?????)."

??? ?????:

"????? ??? ??????? ?? ????? ?????? ??? ????? ???? ??? ????? ?? ??????? ????? ??? ????? (??? ???? ??????? ??????? ? UNPIVOT ?????)."

328 ??????: "???????" ??? ?? ???? "?????"

?? ?????? 328 ?????? ????? ??? ???? ?????? ????? ??? ????? ??? ?????.

?????:
"????? ??????? ??? ???? ??????? ???????? ???? ?????? ??????? ?? ??? ??? (?? ?? ???? ??????? ????????? ?????? ?? ?????? ?????? ???? ?????? ??????? ??????????? ???????)."

???:
"????? ??????? ??? ???? ??????? ???????? ???? ?? ??? ????? ??????? ?? ??? ??? (?? ?? ???? ??????? ????????? ?????? ?? ?????? ?????? ???? ?????? ??????? ??????????? ???????)."

340 ??????: refered ????? ?????? ??? ????? ?? "????? ??????" ?? ??????? ????????? ?? ???? 6-16.

?? ?????? 340 ???? ??????? ????????? ?? ???? 6-16:

"??? ????? ?????? ??? ???????"

??? ?????:

"??? ??????? ?????? ??? ???????"

356 ??????: ???? ???????? ?? ?????

?? ?????? 356 ??? ????? ?????? ?? ?????? 15 ??? ????? ????.

?????:
"????? ????? ???????? ??? ??? ???? ????? ?????? ?? StructLayoutAttribute ?? StructLayout.LayoutKindSequential ??? ?? ????? UDA ?? ???" ? "?? ????."

???:
"????? ????? ???????? ??? ??? ???? ????? ?????? ?? StructLayoutAttribute ?? StructLayout.LayoutKind.Sequential ??? ?? ????? UDA ?? ???" ? "?? ????."

360 ??????: ??????? ??? ????

?? ?????? 360 ????????? ?? ???? ?????? ??? ????.

?????:
SELECT groupid,
CAST(ROUND(EXP(SUM(LOG(ABS(NULLIF(val,0)))))*
(1-SUM(1-SIGN(val))%4)*(1-SUM(1-SQUARE(SIGN(val)))),0) AS INT)
AS product
FROM dbo.Groups
GROUP BY groupid;

???:
SELECT groupid,
CAST(ROUND(EXP(SUM(LOG(ABS(NULLIF(val,0)))))*
(1-SUM(1-SIGN(val))%4)*(1-MAX(1-SQUARE(SIGN(val)))),0) AS INT)
AS product
FROM dbo.Groups
GROUP BY groupid;


364 ??????: ?????? ??????? ?????? ??????? ?? ???? 6-24 ??? ????

?? ?????? 364 ?????? ??????? ?????? ??? ???? 6-24:

"groupid agg_or agg_or_binval"

??? ????? ???:

"groupid agg_and agg_and_binval"

364 ??????: ?????? ??????? ?????? ??????? ?? ???? 6-25 ??? ????

?? ?????? 364 ????? ?????? ??????? ?????? ??? ???? 6-25:

"groupid agg_or agg_or_binval"

??? ????? ???:

"groupid agg_xor agg_xor_binval"

???? 412: "2147483648" ??? ?? ???? "-2147483648"

?? ?????? 412 ?????? ?????? ?? ??????? ??? ?????? ??????? ????? ??? ??? ???? ??? ????.

?????:
"CHECKSUM ?????? ??? ???? ??? 2147483648 ? 2147483647."

???:
"CHECKSUM ?????? ??? ???? ???-2147483648 ? 2147483647."

????? 431 ? 432: #CustStage ??????? ??? ????? ?? #CustsStage

?? ?????? 431 ????? ????? ?????? ? eigth ?????? ???????:

"???? UPDATE ???? ???? ??? ?????? ?? #CustStage. ?? ?? ?? UPDATE ?????? ???? ???? ???? ????? @ + 1 ?? KeyCol ?? ????? @. ???? ???? ?? ?? ?? ???? ???????? @ ????? ?????? ???? ??? ????? ?? KeyCol. ???? ????? ????? ???? ????? ?? ??? ????? ??? ?????? ?? #CustStage."

??? ????? ???:

"???? UPDATE ???? ???? ??? ?????? ?? #CustsStage. ?? ?? ?? UPDATE ?????? ???? ???? ???? ????? @ + 1 ?? KeyCol ?? ????? @. ???? ???? ?? ?? ?? ???? ???????? @ ????? ?????? ???? ??? ????? ?? KeyCol. ???? ????? ????? ???? ????? ?? ??? ????? ??? ?????? ?? #CustsStage."

?? ?????? 432 ? ???? ?????? ?????? ??? ??????:

"??? ??? ??? ????? ????? ???? ????? ??? 0, ??? ????? ?????? #CustStage ??? ????? ??? ??????? ?? ??????? ??????? ???? ? ???? KeyCol ?????? ??? 1 ??? 7."

??? ?????:

"??? ??? ??? ????? ????? ???? ????? ??? 0, ??? ????? ?????? #CustsStage ??? ????? ??? ??????? ?? ??????? ??????? ???? ? ???? KeyCol ?????? ??? 1 ??? 7."

?? ?????? 432 ? ???? ?????? ????? ?? ?????? ??????:

"????? UPDATE T-SQL ?????? ??? ???????? ? ?? ???? ?? ?????? ??? ?????? ?? #CustStage ?? ?? ????? ?????."

??? ?????:

"????? UPDATE T-SQL ?????? ??? ???????? ? ?? ???? ?? ?????? ??? ?????? ?? #CustsStage ?? ?? ????? ?????."

434 ??????: refered usp_AsyncSec ??? ????? ?? usp_AsyncSeq

?? ?????? 434 ?????? ?????? ??? ?????? ?????? ???????:

"??? ???? ??? ????? ?????? AsyncSeq ?? ????? ???. ?? ???????? ??? ????? ????? ??? ??? ???? ?? ??????????? usp_AsyncSec."

??? ?????:

"??? ???? ??? ????? ?????? AsyncSeq ?? ????? ???. ?? ???????? ??? ????? ????? ??? ??? ???? ?? ??????????? usp_AsyncSeq."

445 ??????: ???? SET ??? ???? ?? ????? ????????? ???????? ?????

?? ?????? 445 ?????? ??????? ?? ????? ???? ??????? ?????:

	WHERE C.CustomerID = dbo.Orders.CustomerID);
WHERE C.Country = 'USA';


??? ????? ???:

	WHERE C.CustomerID = dbo.Orders.CustomerID);
WHERE CustomerID IN
  (SELECT CustomerID FROM dbo.Customers WHERE Country = 'USA');


??? 445 ??????: "????" ?? ???? "????"

?? ?????? 445. ????? ?????? ?????? ?? ?????? ??????? ??? ???? ???? ??? ?????.

?????:
"??? ????? ?????? ???? ??? ?????? ? ?????? ?? ? ??? ???? ?????? ???? ?? ????? ?? ????? nondeterministic."

???:
"??? ????? ?????? ???? ??? ?????? ? ???? ? ??? ???? ?????? ???? ?? ????? ?? ????? nondeterministic."

480 ??????: ??? ??????? ????? ????? ?? fn_subordinates1 fn_subordinates2

?? ?????? 480? ?????? ??????? ??? ????? ??????? 9-8:

"????? ????????? ???????? ?? ????? 9-8 ?????? ???? fn_subordinates2 ??? ?????? fn_subordinates2 ??? ????? ?? ?????."

??? ?????:

"????? ????????? ???????? ?? ????? 9-8 ?????? ???? fn_subordinates2 ??? ?????? fn_subordinates1 ??? ????? ?? ?????."

485 ??????: < ??? ?? ???? < =

?? ?????? 485, ?? ????? ????????? ???????? ??????? ??? ????? 12 ????? ??? ??? ??? ????.

?????:
-- and previous level < @maxlevels

???:
-- and previous level <= @maxlevels

493 ??????: ??? ?? ???? "SubsPath" "SubsSort"

?? ?????? 496 ? ???? ??? 36 ?? ????? ???????? ???????? ?? ?????? "SubsPath" ??????? "SubsSort" ?? ???? ????.

?????:
-- #SubsPath is a temp table that will hold the final

???:
-- #SubsSort is a temp table that will hold the final

494 ??????: ??? ?? ???? @ #

?? ?????? 494, ?? ????? ????????? ???????? ????? ?????? ????? ???? INSERT ??? ????? ??? ??? ??? ????.

?????:
-- Load the rows from #SubsPath to @SubsSort sorted by the binary

???:
-- Load the rows from #SubsPath to #SubsSort sorted by the binary

506 ??????: ??????? ??? ???? ????? ?????? ??????

?? ?????? 506 ?????? ?????? ?? ??????? ??? ??? ??? ???? ??? ?????? ??? ????? ?????? ?????? ?????? ??? ???????? ??????.

?????:
"????? ????? ????? ?? ?? ??????? ????? ???? 1 ????? ?????? ????? ??: ???? ??? + ? ????? ?????? + ?. ?."

???:
"????? ????? ????? ?? ?? ??????? ????? ???? 1 ????? ?????? ????? ??: ??? ???? + ?????? ?????? + ?. ?."

513 ??????: ??? ?? ???? ?????? ??? ???? 9-35 ???? ???????

?? ?????? 513 ????? ??? ????? ????? ?? ?????? "?????":

"??? ??? ??? ???? ??????? ???? ??????? ??????? ????? ?? (??????? ?? ???? 9-35). ????? ?????? ??????? ?? ??? ????: "

??? ?????:

"??? ??? ??? ???? ??????? ???? ??????? ??????? ????? ??. ????? ?????? ??????? ?? ??? ???? ????? ??????? ?? ???? ?? ?????? 9-35: "

533 ??????: ??? ?? ???? "BOMCTE" "BOMTC"

?? ?????? 533 ????? ?????? ????? ??? ???? 9-50 ?????? Read ??? ?????.

?????:
"????? ??? ???? ??? ?????? ??????? ???????? ?? BOMCTE ?? ???? ????? ???? DISTINCT ?? ????????? ???????".

???:
"????? ??? ???? ??? ?????? ??????? ???????? ?? BOMTC ?? ???? ????? ???? DISTINCT ?? ????????? ???????".

562 ??????: ????? 36 ????? ?? ????? ????? ???????? ???

?? ?????? 562 ? ???? ?????? ?????? ?? ???????? ??????? 10:

"???? ????? ???? ????? ??? ??? ????? 1 ? 4 ? 9, 16, 25 ? 49, 64, 81 ? 100 ???."

??? ?????:

"???? ????? ???? ????? ??? ??? ????? 1 ? 4 ? 9, 16, 25 ? 36 ? 49, 64, 81 ? 100 ???."

567 ??????: Corretion ??? ???????? ??????? 19

??? ?????? 567 ? ??? "??????? 19: ??? ????? ?? ???????" ? ?? ??? ?????? ????? ????? ?? ??????? - 4 - ??? ????? ?? ???? ?????.

?????:

"??? ?? ????? ????? ?? ??????? ?? ??? ????? ??????: 4, 3, 3 ? 5 ? 4 ? 4 ? 3 ? 5 ? 5 ? 4 ? 3 ? 6 ? 6 ? 8 ? 8 ? 7 ? 7, 9 ? 8 ? 8 ? 6 ? 9 ? 9 ? 11 ? 10 ? 10 ? 9 ? 11 ? 11, 10 ?"

???:

"??? ?? ????? ????? ?? ??????? ?? ??? ????? ??????: 3 ?? 3 ? 5 ? 4 ? 4 ? 3 ? 5 ? 5 ? 4 ? 3 ? 6 ? 6, 8 ? 8 ? 7 ? 7, 9 ? 8 ? 8 ? 6 ? 9 ? 9 ? 11 ? 10 ? 10 ? 9 ? 11 ? 11 ?? 10 ?"

????? Microsoft Press ??? ????? ????? ??? ??????? ??????. ???? ????????? ?????????? ????????? ???????? ????? ?????? ???????? ?? printings ?????????? ?? ??? ??????. ??? ??? ???? ????? ???? ?? ??? ?????? ?? ????? ?????? ??? ???? ?? ???? ????????? ?????.

???????

???? ???????: 920141 - ????? ??? ??????: 12/????/1428 - ??????: 1.14
????? ???
  • Inside Microsoft SQL Server 2005: T-SQL Querying, ISBN 0-7356-2313-9
????? ??????: 
kbmt KB920141 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????920141

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com