Skip to content

Commit 3f2891c

Browse files
More cleanup, line items wrong
I need an editor.
1 parent ccaefdf commit 3f2891c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ Another bug I have with SQL# is that their names are overly precious. They will
1010
I also have less arguments on functions than SQL#. SQL Server does not support optional arguments on functions, and so these are annoying to have to fill out. Also, I forget what they are supposed to be, and I don't recall their documentation telling me if using DEFAULT will work.
1111
Rather than every possible argument under the sun, I do it the old fashion way: I make a new function.
1212
For example, hypothetically, I would do this:
13-
> CompareThese(a,b)
14-
> BestOf3(a,b,3)
15-
> BestOf4(a,b,c,d)
16-
> Or make an agg or a TVF.
13+
<li> CompareThese(a,b) </li>
14+
<li> BestOf3(a,b,3) </li>
15+
<li> BestOf4(a,b,c,d) </li>
16+
<li> Or make an agg or a TVF. </li>
1717

18-
For reduced maintenance, I pass everything NVARCHAR(MAX). Speed is not my main problem. The main problem is that SQL Server functions are severely lacking and new functions are added every third decade. STRING_AGG is great, but a SQLCLR function can go back to at least 2012.
18+
For reduced maintenance, I pass everything as NVARCHAR(MAX) as well as return NVARCHAR(MAX). Speed is not my main problem. The main problem is that SQL Server functions are severely lacking and new functions are added every third decade. STRING_AGG is great, but a SQLCLR function can go back to at least 2012.
19+
20+
I do suspect that their may be memory allocation issues with this design, and so I may come up with a generative way to make VARCHAR(8000) or NVARCHAR(4000) clones. Due to the way SQL Server pre-allocates memory, it may be even better to support smaller sizes. Not really sure.
1921

2022
If it's possible to think of a logical algorithm that can easily be described and understood, and there's no confusion about what to expect in the output, then it's worth being a function.
2123

0 commit comments

Comments
 (0)