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
Harshil Shah
NA
9
15.2k
XML Query is very slow
Mar 28 2012 8:28 AM
Hi,
Declare @String varchar(max) = '1,2,3,4,5,6,7,8,9'
, @Delimiter char(1) = ','
SELECT T.split.value('.', 'nvarchar(max)') AS data
FROM (
SELECT CAST('<d>' + REPLACE(Replace(Replace(@String,'&','&'),'<','<'), @Delimiter, '</d><d>') + '</d>' AS XML) as T1
) as XMLData
CROSS APPLY T1.nodes('/d') T (split)
here @String have 9 data, when @String have more than 2000 data at that time Query get very slow . is there any ohter solution to improve this query.
Thank you.
Reply
Answers (
6
)
how to get max two salary and lowest two salary
SQL SERVER 2008 : bcp command. not copying file to disk