ALTERFUNCTION[dbo].[getPigeonNames] ( @FanciersIDUniqueIdentifier ) RETURNSvarchar AS BEGIN declare@Namesasvarchar(2000) Set@Names='' Select@Names=@Names+','+ Name From Pigeons Where FanciersID =@FanciersIDAND Status=1 --@Names=Select substring(@Names,2,len(@Names)) RETURN@Names END /**//* FileName: p_my_FanciersLoad Description: 处理Fanciers加载数据的存储过程 Author:LingFeng Created: 2006-8-3 14:53:17 BY [LingFeng] USE Hugang's Rapid Tool */ ALTERPROCEDURE[dbo].[p_my_FanciersList] AS BEGIN BEGIN TRY -- BEGIN TRAN --如果有别的扩展代码,请使用事务 SELECT [FanciersID], [ID], [Name], [Gender], [Birthday], [Nationality], [Address], [PostCode], [Phone], isnull([Picture],'') AS Picture, isnull([Introduction],'') AS Introduction, [LastLoginTime], [Status], [CheckinTime], AccountID, dbo.getPigeonNames(FanciersID) AS PigeonNames FROM Fanciers -- COMMIT TRAN; END TRY BEGIN CATCH IF (@@TRANCOUNT>0) BEGIN DECLARE@strMsgASvarchar(2000) SET@strMsg='p_my_FanciersLoad: 无法使用 p_my_FanciersLoad 加载数据。'+ ERROR_MESSAGE() RAISERROR20000@strMsg -- ROLLBACK TRAN END EXECUTE[dbo].[p_SYSTEM_LogError]; END CATCH END