Viewing 3 posts - 1 through 3 (of 3 total)
declare @mylist nvarchar(100), @delimiter VARCHAR(2)
set @mylist = 'A,B, C, D , 1, 2,345, EFG, H, '
set @delimiter = ','
select@mylist list,
(LEN(@mylist) - LEN(replace(@mylist,@delimiter,'')))/LEN(@delimiter)
+
case when right(rtrim(LTRIM(@mylist)),1) = @delimiter then 0 else 1...
July 14, 2011 at 4:51 am
Yet another way to get last day of the month
Select DATEADD (mm, DATEDIFF (mm, 0, getdate ()) +1,-1)
July 14, 2011 at 4:35 am
To get the number of times a particular string occurs in another string
DECLARE @STR VARCHAR(100) = 'ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE'
DECLARE @SEARCH VARCHAR(10) = 'A'
-- TO GET THE NUMBER OF OCCURRENCE COUNT
SELECT...
July 14, 2011 at 3:28 am
Viewing 3 posts - 1 through 3 (of 3 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy