摘要:
DECLARE @Results VARCHAR(MAX)SELECT @Results = ( SELECT TOP 10 CAST(tn.NewsId AS VARCHAR) + ',' FROM dbo.TB_News tn ORDER BY tn.NewsId DESC FOR XML PATH('') )SELECT @Results---注意:PATH 括号及括号中参数为非必填项,设置... 阅读全文
摘要:
DECLARE @MyCur CURSORSET @MyCur = Cursor Local Scroll FOR SELECT TopicID,PostTable FROM TB_BBS_Topic WHERE BoardID = @SrcBoardID AND DATEDIFF(DAY,DateAndTime,GETDATE())> @Days OPEN @MyCur FETCH NE... 阅读全文
摘要:
set ANSI_NULLS ONset QUOTED_IDENTIFIER ONGOALTER FUNCTION [dbo].[fn_split](@Source VARCHAR(MAX),---The string to be separated@Separator CHAR(1) ---Separator)RETURNS @TB TABLE(VL VARCHAR(100))ASBEGIND... 阅读全文