Viewing 15 posts - 2,746 through 2,760 (of 8,416 total)
steve-893342 (9/2/2010)
Yes precisely, the number of rows returned from the split is defined as (number of commas) + 1
Ok, let's go with that. Thanks for persisting 🙂
CREATE ASSEMBLY...
September 2, 2010 at 9:46 am
steve-893342 (9/2/2010)
Returns 14 rows when it should return 15
Are you expecting the "A,B,C,D," to produce 5 records?
To me, the trailing comma is delimiting the 'D' and so should not result...
September 2, 2010 at 8:13 am
steve-893342 (9/2/2010)
Just one minor problem that it doesn't return the last item if it's blank.
Not sure I agree - a single trailing delimiter shouldn't return an extra blank record, should...
September 2, 2010 at 6:42 am
A very good article - I have no idea why it's rating is so low.
Well done.
September 2, 2010 at 4:08 am
I try to avoid NULLs, as far as is practicable, in my designs. They complicate coding and often result in suboptimal query performance.
In suitable cases, I have no problem...
September 2, 2010 at 3:37 am
Steve,
I found a few spare minutes to slightly modify Adam's routine to work the way you want:
CREATE ASSEMBLY Utility
AUTHORIZATION dbo
FROM ...
September 2, 2010 at 2:32 am
Another option using EXISTS:
SELECT *
FROM dbo.Test T1
WHERE EXISTS
(
SELECT...
September 1, 2010 at 10:08 pm
steve-893342 (9/1/2010)
Great function Paul:-) Is there a way of adapting it to include a row number and return values for the blank items as well?
Well the credit is Adam's...
September 1, 2010 at 7:30 pm
Neither scalar nor multi-statement UDFs show in IO stats. In-line TVFs do, because they are expanded into the query (just like a parameterized view would) before optimization.
September 1, 2010 at 6:25 am
You can't create temporary functions, no.
It sounds as if you are writing code to concatenate strings, perhaps to create a CSV-style output?
There is an excellent performance comparison of the main...
September 1, 2010 at 6:05 am
On my machine, the fastest solution is based on Adam Machanic's excellent CLR string splitter. I include it here for others to compare:
CREATE ASSEMBLY Utility
...
September 1, 2010 at 5:52 am
An excessive number of columns in a GROUP BY clause is almost always a sign of a database design or query that has considerable scope for improvement 🙂
Often, the GROUP...
September 1, 2010 at 3:37 am
There's no functional difference, it's just a scripting quirk.
September 1, 2010 at 3:19 am
Partitioning does not require a clustered index at all.
Here's a script I use to demonstrate that fact.
It also demonstrates the indexed view switching possible in SQL Server 2008.
If you are...
September 1, 2010 at 3:15 am
Bit late to the party, but just for the record - I'm not a DBA either.
August 31, 2010 at 4:19 am
Viewing 15 posts - 2,746 through 2,760 (of 8,416 total)