Linked Questions
261 questions linked to/from How do I split a delimited string so I can access individual items?
196
votes
27
answers
712k
views
T-SQL split string [duplicate]
I have a SQL Server 2008 R2 column containing a string which I need to split by a comma. I have seen many answers on StackOverflow but none of them works in R2. I have made sure I have select ...
138
votes
16
answers
272k
views
Split function equivalent in T-SQL? [duplicate]
I’m looking to split '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15...' (comma delimited) into a table or table variable.
Does anyone have a function that returns each one in a row?
139
votes
11
answers
190k
views
T-SQL: Opposite to string concatenation - how to split string into multiple records [duplicate]
Possible Duplicate:
Split string in SQL
I have seen a couple of questions related to string concatenation in SQL.
I wonder how would you approach the opposite problem: splitting coma delimited ...
5
votes
3
answers
36k
views
How to split string into columns for a view? [duplicate]
I have a column (full_location_id) in a table that contains a string is delimited by '-' which I need to split up into 4 columns in a view (Test_SplitColumn). Not every record in full_location_id ...
4
votes
2
answers
12k
views
SQL Server split by comma [duplicate]
I have a question about splitting column values in T-SQL.
I have
Address_col
Nevada,USA
Tokyo,Japan
Hanoi,Vietnam
I want to split the values by comma to
Address_col Country
Navada ...
0
votes
5
answers
6k
views
Find substring/charindex T-sql [duplicate]
I have the following variable.
DECLARE @TestConnectionString varchar(255) = 'Data Source=123.45.67.890;User ID=TestUser;Password=TestPassword;Initial Catalog=TestCatalogName;Provider=SQLNCLI11.1;...
1
vote
3
answers
3k
views
Splitting string after specific character in sql [duplicate]
I have for example this string name-surname-15A-15B and for example if I want to get the last segment(which is 15B) I can use the following query:
Select right(Code, charindex('-', reverse(Code)) - 1)...
0
votes
1
answer
11k
views
SELECT a string formatted array by row in SQL Server [duplicate]
For instance I have a string parameter @p_colors with a value like:
'yellow','blue','red'
which is passed into a stored procedure. And when I try to select it like this:
EXECUTE(CONCAT('SELECT ', @...
4
votes
3
answers
3k
views
SQL query to retrieve values from a comma separated column [duplicate]
Possible Duplicate:
Split string in SQL
Searching a column with comma seperated values
In my PHP project I'm facing a problem to write a SQL:
I have a table "consultants" with fields categories ...
0
votes
3
answers
5k
views
SQL - Convert String of numbers to list of integers [duplicate]
am passing in a string of numbers and would like to convert this string into a list of numbers e.g.
SELECT personID from person WHERE personID IN ('927,6944')
How do I convert ('927,6944') to (927,...
1
vote
0
answers
7k
views
SQL STRING_SPLIT not working [duplicate]
I have a string like so:
DECLARE @columnCamera varchar(MAX) = 'aaa,bbb,ccc'
and I am trying to split these and loop through, I am stuck on the splitting part:
SELECT * FROM STRING_SPLIT(@...
0
votes
3
answers
4k
views
How to split parameter in stored procedure [duplicate]
This is the stored procedure:
CREATE PROCEDURE [dbo].[StoredProcedure]
@FILTERNAME varchar(100) = ''
AS
IF @FILTERNAME <> ''
BEGIN
SELECT
CODE, NAMEen, NAMEkr
...
0
votes
3
answers
3k
views
Split string into new column [duplicate]
There is a column containing following e.g. abcd/ef/g/hij.
Characters between the / are dynamic not fix.
I want to split in a select query the content into 4 separate new columns.
The already ...
-1
votes
1
answer
4k
views
How to split string by forward slash in SQL Server? [duplicate]
There is no default split function in SQL Server 2012 that I'm using.
I want to split the string (ex: /Folder1/Folder2/) by /.
if string is /Folder1/ then output should be Folder1,
if string is /...
0
votes
2
answers
2k
views
SQL Server Alternative to Split String [duplicate]
I cannot use the split_string function and I cannot alter the database to set the compatibility level to what I need.
I have a column with the following example values:
JohnDoe-123-fakestreet-02-...