XE

Technical Article

RE: Need to seperate string in two columns using T-SQL

  • Reply

create table testtable (Col1 varchar(50), Col2 varchar(50), Col3 varchar(50)) go insert into testtable (Col1) SELECT 'Americas - NorthEast' UNION SELECT 'Americsa - SouthEast' UNION SELECT 'Europe - North Region' UNION SELECT 'Asia - SouthEast' GO SELECT * FROM TESTTABLE update testtable    SET COL2 = LEFT(COL1,PATINDEX('% %', COL1)),        COL3 = RIGHT(COL1,LEN(COL1)-(PATINDEX('%-%', COL1)+1)) GOSELECT * […]

You rated this post out of 5. Change rating

2005-02-09

Blogs

Real-World SQL Mastery: Your Hands-On, Mess-Free Sandbox

By

Are you ready to take your SQL skills from theoretical to tactical? If you've...

Set a Runtime Variable in an Azure DevOps Pipeline

By

Note: I DO NOT recommend this. Any changes to a pipeline should be in...

A New Word: Symptomania

By

symptomania – n. the fantasy that there’s some elaborate diagnosis out there that neatly...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers