TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
srinivas P
NA
168
193.1k
Can i pass more than two column names to split function?
Sep 5 2011 1:16 AM
I have split function,in the following way
create
function
split
(@
list varchar
(
max
),
@
delimiter char
(
1
))
returns
@
shards
table
(
value varchar
(
8000
))
with
schemabinding
as
begin
declare
@
i int
;
set
@
i
=
0
;
while
@
i
<=
len
(@
list
)
begin
declare
@
n int
;
set
@
n
=
charindex
(@
delimiter
,
@
list
,
@
i
);
if
0
=
@
n
begin
set
@
n
=
len
(@
list
);
end
insert
into
@
shards
(
value
)
values
(
substring
(@
list
,
@
i
,
@
n-
@
i
+1
));
set
@
i
=
@
n
+1
;
end
return
;
end
Using above function we can pass only one column name at a time,
But my requirement is to pass more than one column Names to split function.
is it possible?
Any thoughts Help me
Reply
Answers (
3
)
Auto increment Number in SQL Server 2000?
Split multiple columns into single column by delimiter?