16 Nisan 2011 Cumartesi

Split string with parsename- sql virtual array

DECLARE @test nvarchar(256)= 'lorem.er.deneme.test'

 

SELECT PARSENAME(@test,1),PARSENAME(@test,3),PARSENAME(@test,2),PARSENAME(@test,4)

image

 

DECLARE @FullName NVARCHAR(500)

 

SET @FullName = N'Flintstone, Mr.Fred, Jr'

 

SELECT PARSENAME(FName, 3) AS "Title",

       PARSENAME(FName, 2) AS "FirstName",

       PARSENAME(FName, 4) AS "LastName",

       PARSENAME(FName, 1) AS "Prefix"

  FROM ( SELECT REPLACE(@FullName, ', ', '.')) D(FName)

 

Hiç yorum yok:

Yorum Gönderme