Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
CREATE Function [dbo].[Split](@CommaDelimitedFieldNames Varchar(Max), @CharToFind VarChar(10) )
Returns @Tbl_FieldNames Table (Position Integer Identity(1,1), FieldName VarChar(1000)) As
Begin
Set @CommaDelimitedFieldNames = @CommaDelimitedFieldNames + @CharToFind
Declare @Pos1 Int
Declare @pos2 Int
Set @Pos1=1
Set @Pos2=1
While @Pos1<Len(@CommaDelimitedFieldNames)
Begin
Set @Pos1 = CharIndex(@CharToFind, @CommaDelimitedFieldNames,@Pos1)
Insert @Tbl_FieldNames Select Cast(Substring(@CommaDelimitedFieldNames,@Pos2,@Pos1-@Pos2) As VarChar(100))
Set @Pos2=@Pos1+len(@CharToFind)
Set @Pos1 = @Pos1+Len(@CharToFind)
End
Return
End
Declare @Temp Table(Id Int, Data Varchar(max))
Insert Into @Temp Values(1, 'Line 1' + Char(13) + Char(10)
+ 'Line 2' + Char(13) + Char(10)
+ 'Line 3' + Char(13) + Char(10)
+ 'Line 4' + Char(13) + Char(10)
+ 'Line 5')
Insert Into @Temp Values(2, 'Line A' + Char(13) + Char(10)
+ 'Line B' + Char(13) + Char(10)
+ 'Line C' + Char(13) + Char(10)
+ 'Line D' + Char(13) + Char(10)
+ 'Line E')
Select *
From @Temp T
Cross Apply dbo.Split(T.Data, Char(13) + Char(10)) As Data
Where T.Id = 2
And Data.Position = 3