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
Ankit Shukla
NA
681
116.8k
Problem in table valued function in sql
Dec 23 2019 1:03 AM
Hello,
My function is:
create FUNCTION [dbo].[Split_cognos]
(
@String NVARCHAR(max), --New Value
@Delimiter NVARCHAR(5)
)
RETURNS @SplittedValues TABLE
(
OccurenceId SMALLINT IDENTITY(1,1),
SplitValue NVARCHAR(max)
)
AS
BEGIN
DECLARE @SplitLength int
WHILE LEN(@String) > 0
BEGIN
SELECT @SplitLength = (CASE CHARINDEX(@Delimiter,@String) WHEN 0 THEN
LEN(@String) ELSE CHARINDEX(@Delimiter,@String) -1 END)
INSERT INTO @SplittedValues
SELECT SUBSTRING(@String,1,@SplitLength)
SELECT @String = (CASE (LEN(@String) - @SplitLength) WHEN 0 THEN ''
ELSE RIGHT(@String, LEN(@String) - @SplitLength - 1) END)
END
RETURN
END
When I call this function like :
SELECT SPLITVALUE FROM dbo.Split(N'??????????,????????',',')
Output is not converted in NVARCHAR. (Output is : ???????)
Please help
Thanks
Reply
Answers (
1
)
Auto Increment value increase to higher amount in Sql Server
how to update primary key which is auto inrement in sql