Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Split into multiple rows after certain character

$
0
0
Hi,I need to remove the number and semicolon and # and just get the text and insert as two rows . CREATE TABLE #Split ( ID INT, Texts NVARCHAR(100) ) INSERT INTO #Split (ID,TExts) SELECT 1,'136;#BRZ Brazil' UNION SELECT 2,'135;#BRZ Brazil;#260;#VEN Venezuela' SELECT * FROM #Split--Desired resultsSELECT 1 AS ID,'BRZ Brazil' AS Texts UNIONSELECT 2 as ID,'BRZ Brazil' AS Texts UNIONSELECT 2 as ID,'VEN Venezuela' AS TextsPlease help.Thanks,PSB

Viewing all articles
Browse latest Browse all 3145

Trending Articles