FIX: ??? SQL Server 2008 ??? ?? ??????? ?????? ?? ?????????? ?? ?? ?? ??? ??? ????????? ?? ??-??? ??? ?? ?????? ??? ??????

???? ?????? ???? ??????
???? ID: 2322209 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

?????

Microsoft SQL Server 2008, ?? ??? ?? ?? ???????? ?? ????? ???? ????? ???????????

1 ????????

WITH ??? ?? ????? ???? ??? ?? ??????? ?????? ?????????? (CTE) ????????? ??? ?????? ?? ???, ?? ????? ????? ??????.
WITH common_table_expression AS 

(SELECT * FROM sys.objects)

(SELECT *

FROM common_table_expression)
???? ???, ?? ????? ?? ???????
SELECT *

FROM sys.dm_exec_query_stats

WHERE statement_start_offset > statement_end_offset

AND

statement_end_offset <> -1
?????? ?? ???????? ???, ?? ?????? ?? ??? ????? ?????? ????? ???? statement_start_offset ?? statement_end_offset ??? ??? ??? ????? ??? ??, ?? ????? statement_end_offset ??? statement_start_offset ??? ?? ?? ?? ?? ?? sys.dm_exec_query_stats ???????? ??????? (DMV) ?????.

?? ?????? ?? ???? ???? ??????? ?? ??????????? ?? ???? ?? ???? ?? ??????? ????? statement_start_offset ??? ????? ?? ???? ?? statement_stop_offset ????

???????? 2

WITH ??? ?? ????? ???? ??? ?? ??????? ?????? ?????????? ????????? ????, ?? RECOMPILE ?????? ?? ????? ????? ?????? ?? ???, ?? ????? ??? ?????? SQL Server 2008 ??? ????? script. ?? ????? ????
CREATE FUNCTION function1() RETURNS int AS
BEGIN
DECLARE @x int
SET @x=1;
WITH common_table_expression AS

(SELECT @x AS column1)

(SELECT @x=column1 FROM common_table_expression)

OPTION(RECOMPILE)
RETURN @x
END
?? ?? ? dbo.function1() ?? ??? ???? ? ?????? ????? ???, ?? ???? ????? ?????? ?????:
??????? ???? ?? ?? ????? ?????? ??????? ???? ??????, ??? ??? ??, ????? ?? ????????.

??? ??, ?? ?????? ?? ? ???? ??? SQL ????? ?? ????? ?? ??? ?? RECOMPILE ?????? ???? ???? ????? ????????

???????? 3

WITH ??? ?? ????? ???? ??? ?? ??????? ?????? ?????????? ????????? ??? WITH ??? ??? ?? ????????? ?????? ?? ????? ???? ??? ?????? ?? ???, ?? ????? ????? ??????.
WITH computed_table (id) AS
(SELECT id 
FROM this_table_does_not_exist) 
(SELECT id 
FROM dbo.computed_table) 
GO
?? ?? ?? ??????, ???? ???? ???? ?????? ?? ??? ???????? ???????

????

?? WITH ??? ???????? ??? ??? ?? ?? malfunctioning ????????? ?? ???? ?? ???????? ??? WITH ??? ?? ????? ????? ????????.
WITH common_table_expression AS

(CTE_query_definition)
?? ?? ??? ????? ?????? ??? ?? ?? ??????? ?????? ?????????? ??? ????????? ???? ??? ?? ?? ???? ?? ??? ????? ???? ??? ??? ???? ???, ???? ?? ?? ??? ???? ??? ?? ?? ??? ?? ???? ??? ??? ??????, ??? ?? ????? ??? ?????? ?? ?? ???? ??? ?????? ?? ??? ???????? ???? ?? ??? ?????? ???? ?? ???? sys.dm_exec_query_stats ???????? ??????? ????? ?? ????? ?? ?????? ????, ???? ??? ?????? ?? ???? ??????.

????????

SQL Server 2008 ?????? ??? 2 CTP ??? ?? ???????? ?? ?? ?? ??? ??????? ?? ??????? ?????? SQL Server 2008 ???? ???.
968382SQL Server 2008 ?? ??? ?????? ?????? ??? ?? ??????? ???? ?? ??? ???? ????
The SQL Server 2008 ?????? ??? 2 CTP Microsoft ??????? ?????? ?? ??????? ???? ?? ????:
SQL Server 2008 ?????? ??? 2 CTP

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

?? ???????? ?? ?? ???? ?? ??? ?????? ?? ??????? ?????? ?????????? ???????? ??? ?? ??????? ?? ??? ??? ?????? ?? ???, ????? ?? ????? ???? ?? ??? ?????????. ??? ?? ??? ?????
WITH common_table_expression AS 

(SELECT *
FROM sys.objects)

(SELECT *

FROM common_table_expression)
?? ???????? ?? ?? ???? ?? ??? ???????? ?? ????? ?? ??? ?? ????? ???? ?? ??????????
WITH common_table_expression AS 

(SELECT *
FROM sys.objects)
SELECT *

FROM common_table_expressio

??????

Microsoft ?? ?????? ?? ?? ?? ??? ???????? Microsoft ???????? ??? ?? ?? ?????? ?? "?? ?? ????" ????

???? ???????

WITH ??? ?? ??? ?? ??????? ?????? ?? ?????????? ?? ????? ???? ???? ?? ???? ??? ???? ??????? ?? ??? ????? MSDN ??? ??? ?? ????:
WITH common_table_expression (Transact-SQL)
Sys.dm_exec_query_stats ?? ???? ??? ???? ??????? ?? ??? ????? MSDN ??? ??? ?? ????:
sys.dm_exec_query_stats (Transact-SQL)

???

???? ID: 2322209 - ????? ???????: 31 ????? 2010 - ??????: 1.0
???? ???? ???? ??:
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Workgroup
??????: 
kbqfe kbfix kbexpertiseadvanced kbsurveynew kbtshoot kbquery kbmt KB2322209 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:2322209

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

 

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