Viewing 15 posts - 181 through 195 (of 422 total)
Full-text search per Sean's recommendation definitely sounds like the best long-term solution. But implementing full-text search is not trivial either. To be effective you will need to look up a...
April 19, 2013 at 5:41 pm
Jeff Moden (4/14/2013)
Please consider using a Tally Table instead of a recursive CTE to count. Please see the following article as to why.
Thanks for the suggestion Jeff.
Below is...
April 19, 2013 at 4:56 pm
Take a look at this thread:
Identify node and tag in XML data using T-sql
I think you are asking the same thing as the poster in that thread and there's some...
April 10, 2013 at 3:08 pm
Lynn Pettis (4/8/2013)
The following is...
April 9, 2013 at 11:22 am
Lynn Pettis (4/8/2013)
Steven Willis (4/8/2013)
April 8, 2013 at 7:34 pm
I arranged the solution in a verbose manner so that the original poster could follow the steps I used to parse the data. The problem with that data is that...
April 8, 2013 at 6:50 pm
Jeff, just FYI...I created the million row table on my slow laptop and tested the code from your article. With a normal SELECT statement it took appx 19-22 secs per...
April 8, 2013 at 5:23 pm
Lynn Pettis (4/5/2013)
If you have duplicate dates, this fails. You will want to change RANK() to ROW_NUMBER().
Good catch Lynn. But I don't think just changing to ROW_NUMBER fixes the...
April 5, 2013 at 5:51 pm
I don't know if this is any better than Luis' code above, but it gives you another alternative way of looking at the problem.
;WITH sampledata AS
(
SELECT * FROM
(VALUES
...
April 5, 2013 at 5:40 pm
;WITH sampledata AS
(
SELECT * FROM
(VALUES
(1,'2013-01-01','fred'),
(2,'2013-01-05','ralph'),
(3,'2012-12-31','jane'),
(4,'2012-12-15','suzie')
) DATA (ID,EndDate,Name))
,
cteRank AS
(
...
April 5, 2013 at 3:51 pm
Then it's basically:
WITH
cte1
AS
(
SELECT * FROM Blah1
),
cte2
AS
(
SELECT * FROM Blah2
),
cte3
AS
(
...
April 4, 2013 at 10:14 pm
I agree with the other posters that it's not quite clear what you are trying to achieve, but I think a simple CROSS APPLY will give you the result you...
April 4, 2013 at 12:53 pm
;WITH sampledata AS
(
SELECT * FROM
(VALUES
(1,5,6,3),
(2,4,2,5),
(3,1,1,2),
(4,4,2,3),
(5,1,2,7)
) DATA (ID,C1,C2,C3))
SELECT TOP(1)
...
April 4, 2013 at 12:26 pm
Good article Dwain. Until you've seen rows unexpectedly deleted by an incorrectly designed MERGE statement I guess you just hum along unaware of the "hazard." I'd say it's like writing...
April 3, 2013 at 9:53 am
First set up some sample data (it would help in the future if you provide a populated temp table for sample data):
/* THIS IS JUST FOR GENERATING SAMPLE SOURCE DATA...
April 2, 2013 at 8:12 pm
Viewing 15 posts - 181 through 195 (of 422 total)