Viewing 15 posts - 46 through 60 (of 4,080 total)
There is a difference between returning a null value and returning no rows. What would the batchID be if there are no rows for a given batchID?
If you have another...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 25, 2021 at 5:05 pm
Lots of ways to skin this cat. You can join to the tblOperator table twice (one of them should be a match. ) and use COALESCE to get the...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 24, 2021 at 3:53 pm
I totally agree with Grant on searching against a function leading to table scans and the potential for an injection attack. Even though you are using sp_ExecuteSQL, you are...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 24, 2021 at 3:22 pm
The key to your problem is that you want two rows to be generated from a single rows. My favorite technique for accomplishing this is to use CROSS APPLY...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 22, 2021 at 1:35 pm
I agree. Nested loops are not considered RBAR. There are alternative ways to code for getting only the latest row, but the best thing you can do for performance...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 22, 2021 at 1:19 pm
Summing case statements instead of doing a PIVOT, is referred to as a cross tab.
Also, I hear you talking about the overhead of a CROSS APPLY. I've never experienced...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 18, 2021 at 3:14 am
I feel compelled to confess that the calendar table I use has all the dates. I'm actually delighted that the "Some people prefer" invited such rebuttals. Also those...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 14, 2021 at 11:44 pm
Apparently, I am serving SPAM too. Just noticed this on the 2016 development forum.
In: Pentobarbital for sale https://hospitableending.com/?
By: The Dixie Flatline
I've heard of "Phenobarbitol", but not Pentobarbital. Go figure.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 12, 2021 at 11:12 pm
Scott, just asking for clarification. You spoke of finding the UNPIVOT syntax kludgy (and I agree) but you posted the "crosstab" syntax which is the old-school way to PIVOT rows...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 12, 2021 at 10:45 pm
It's easy and flexible to include weekends in a Calendar table, usually with two flags one that says weekends, one that says holidays. Sometimes Christmas falls on a Saturday, but...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 12, 2021 at 10:31 pm
I am just editing this message because the more you look the stranger things seem. I would have agreed with your comment about nested transactions. But look what happens...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 11, 2021 at 3:10 pm
One comment. For your example #10, deleting a range of rows, you used the following
DELETE FROM EMPLOYEE WHERE FName LIKE '%Kokou%';
Because the search argument began with...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 11, 2021 at 3:00 pm
I wouldn't expect to have to use two ROLLBACKS. I thought one ROLLBACK set @@TRANCOUNT to zero. (See below.)
In any event, I've never seen a need to use SET IMPLICIT...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 10, 2021 at 8:57 pm
declare @Sample_Data table
(
id varchar(20) ,
Eid varchar(20),
typ varchar(20),
dur float
)
insert into @Sample_Data (id,Eid,typ,dur) VALUES ('1','e1','t1','18.00');
insert into @Sample_Data (id,Eid,typ,dur) VALUES ('2','e2','t1','14.00');
insert into @Sample_Data (id,Eid,typ,dur) VALUES...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 10, 2021 at 8:22 pm
Just a thought, and probably not a very good one. But in lieu of status flags validating rows, or exclusion tables. Why not remove suspect/invalid rows to other tables with...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 10, 2021 at 3:59 pm
Viewing 15 posts - 46 through 60 (of 4,080 total)