|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, March 14, 2013 4:15 AM
Points: 3,240,
Visits: 4,960
|
|
Comments posted to this topic are about the item Get default values of parameters in stored procedures
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sometimes, winning is not an issue but trying. You can check my BLOG here
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, December 23, 2010 9:13 AM
Points: 46,
Visits: 78
|
|
| People may not know what is dbo.fnSplit that you use in this example...
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, March 14, 2013 4:15 AM
Points: 3,240,
Visits: 4,960
|
|
Here is the script of dbo.fnSplit function;
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
CREATE function [dbo].[fnSplit] (@pString nvarchar(max),@pSplitChar char(1)) returns @tblTemp table (tid int,value varchar(1000)) as begin declare @vStartPosition int declare @vSplitPosition int declare @vSplitValue varchar(1000) declare @vCounter int set @vCounter=1 select @vStartPosition = 1,@vSplitPosition=0
set @vSplitPosition = charindex( @pSplitChar , @pString , @vStartPosition ) if (@vSplitPosition=0 and len(@pString) != 0) begin INSERT INTO @tblTemp ( tid , value ) VALUES ( 1 , @pString ) return --------------------------------------------------------------->> end set @pString=@pString+@pSplitChar while (@vSplitPosition > 0 ) begin set @vSplitValue = substring( @pString , @vStartPosition , @vSplitPosition - @vStartPosition ) set @vSplitValue = ltrim(rtrim(@vSplitValue)) INSERT INTO @tblTemp ( tid , value ) VALUES ( @vCounter , @vSplitValue ) set @vCounter=@vCounter+1 set @vStartPosition = @vSplitPosition + 1 set @vSplitPosition = charindex( @pSplitChar , @pString , @vStartPosition ) end return end
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sometimes, winning is not an issue but trying. You can check my BLOG here
|
|
|
|