Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2015-01-02 : 04:26:45
|
Hi I am recieving complete row in one single column and I have pipe delimeter in this row . I want to retrieve the data in individual columnsCurrently row is in one column Data02|vinod sahuExpected output Col1 col202 VInod Sahuplease suggest me on thisVijay is here to learn something from you guys. |
|
mandm
Posting Yak Master
120 Posts |
Posted - 2015-01-02 : 07:49:23
|
If you search SQL Team for split string you will find a number of solutions.Here is one of them. http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=157949 |
|
|
pascal_jimi
Posting Yak Master
167 Posts |
Posted - 2015-01-05 : 03:12:39
|
declare @new table(id int not null identity(1,1), data nchar(50))insert into @newselect'02|vinod sahu'select*from @newselect substring(data,1,2) as col1 ,substring(data,4,10) as col2 from @newhttp://sql-az.tr.gg/ |
|
|
Tusharp86
Starting Member
9 Posts |
Posted - 2015-01-05 : 04:08:06
|
select SUBSTRING(data, 1, CHARINDEX('|', data) - 1) as Col1 , SUBSTRING(data, CHARINDEX('|', data) + 1, LEN(data)) as Col2 from tablename |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|