Declare @products varchar(200) = 'one::two::tree'
Declare @individual varchar(20) = null
declare @res table(ident int identity(1,1),val varchar(20))
WHILE LEN(@products) > 0
BEGIN
IF PATINDEX('%::%',@products) > 0
BEGIN
SET @individual = SUBSTRING(@products, 0, PATINDEX('%::%',@products))
Insert into @res (val) values (@individual)
SET @products = SUBSTRING(@products, LEN(@individual + ';;') + 1,
LEN(@products))
END
ELSE
BEGIN
SET @individual = @products
SET @products = NULL
Insert into @res (val) values (@individual)
END
END
Select * from @res p
Pivot( max(p.val) for p.ident in ([1],[2],[3]) ) as PIV
Tuesday
ms sql split string into columns
here is excellent example how to split string into columns in TSQL (microsoft SQL server)
.bat random number generator
here is example how to use random in bat files in simple 'guess number' game.
to call it : game.bat [total numbers to pick from] [your number]
for example : game.bat 6 3
to call it : game.bat [total numbers to pick from] [your number]
for example : game.bat 6 3
set /a NUM = ( %1 * %random% ) / 32768 + 1
IF "%NUM%" EQU "%2" (echo "winner!") else (echo "loose %NUM%")
Subscribe to:
Posts (Atom)
make ubuntu business casual
to make ubuntu business casual - make it black remove background: gsettings set org.gnome.desktop.background picture-options ...
-
2010-11-24 Update: Please download latest version of Pidgin , that has this problem fixed , no additional steps required. Here are 3 ways to...
-
$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...
-
Error:The element 'Schedule' has invalid child element 'RecurrenceRule'. List of possible elements expected: 'Occurring...