Viewing 15 posts - 286 through 300 (of 1,390 total)
The fellow with the "Accepted" answer made the same mistake and worse because he used DENSE_RANK on the days. Unfortunately for him, there were enough days in the original...
December 27, 2022 at 2:59 pm
Before the pivot it needs to enumerate the rows partitioned within portfoliocode(s). Once you have the 1's and 2's (if any) you could pivot using conditional aggregation, or the built-in...
December 17, 2022 at 1:59 am
I want to defer this process as long as possible. To me that means always aiming for the latest and greatest version. SQL Server releases roughly every 2-3 years,...
December 15, 2022 at 2:13 pm
Not sure about SSIS specifically but in T-SQL the following seems to be equivalent afaik and unless it can be proven otherwise 🙂
select case when '1900-01-01'='1900-01-01' then...
December 5, 2022 at 12:32 pm
Imo this is a guessing puzzle unless there's more of an explanation. What are the rules to apply here? Why not remove all of the dashes '-' and then concatenate...
December 2, 2022 at 3:15 pm
By default SQL Server performs integer division on integers which means decimal remainders are truncated. The DB Engine switches to floating point math if the denominator of a fraction is...
December 1, 2022 at 1:36 pm
Sorry not able to replicate the issue. The OP code relies on implicit conversion between INT and NVARCHAR which generally works but is an error prone (and awful for the...
December 1, 2022 at 1:14 pm
TRIGGER_NESTLEVEL? I usually try to persuade novices out of it. Maybe the non-INSTEAD OF triggers could ask themselves: "Have I been executed at an inappropriate nest level?"
November 29, 2022 at 11:49 pm
The textbooks say writing your own loops in relational database code is something to be avoided. Are you sure it's necessary to write loops?
November 29, 2022 at 3:00 pm
SGAB, does any one have a decent example of an Instead Of Update trigger that will handle more than one bloody row at a time and also ONLY update...
November 29, 2022 at 2:38 pm
To generate sample data you could use a Tally table and calculate a datetime column. This generates 400 rows and calculates a column 'sample_dt' which starts with the current...
November 28, 2022 at 9:33 pm
Interesting and much appreciated. Happy Thanksgiving!
November 23, 2022 at 4:42 pm
If you load up one of the strings with a bunch of commas it causes an error afaik. JSON doesn't care how many commas in a row. A tiny point...
November 22, 2022 at 7:40 pm
Comma is not an escape character in JSON (towards the bottom of the page) 😉
November 22, 2022 at 6:51 pm
Viewing 15 posts - 286 through 300 (of 1,390 total)