Viewing 15 posts - 481 through 495 (of 1,424 total)
After following Ken and Jeff's advice first maybe have a look at the error handling and flow of control. You've got TRY/CATCH all over the place and GOTO and it's...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
February 14, 2022 at 8:44 pm
The explanation seems somewhat open to interpretation. Maybe you could explain why Brazil's ItemCount is 300 and not 500? If 500 is the correct number for Brazil then maybe something...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
February 12, 2022 at 12:19 pm
You have an explicit transaction called from within BEGIN TRY/END TRY yet the ROLLBACK (which presumably corresponds to the transaction) is in the CATCH block. Checking XACT_STATE in...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
February 7, 2022 at 5:27 pm
... has failed throwing:
'Error converting data type varchar to numeric.'
The where clause is comparing a nvarchar field with a simple three character text string, no numerics to be seen...
Shaunos
Cheers...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
February 6, 2022 at 1:40 pm
Hello Everyone,
I just started a developing a new application for hospitals (for maintaining hospital staff, patient, appointments etc.). I started with the database part first.
I will use APIs as...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
February 5, 2022 at 2:32 pm
I totally agree, Grant.
I'm looking at introducing "software engineering" as a topic to discuss at work with the data engineers, and introduce them to all of those concepts like...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 29, 2022 at 2:11 pm
Oops, I edited the code above and posted instead grr. Preemptively, imo concatenation is preferable to replacement when the strings are not complicated (such as this one here) because it...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 27, 2022 at 2:14 pm
This seems to return the correct results and could be "more optimized" (depending on cardinalities, indexes, etc.)
select C1
from #Base
group by C1
having sum(iif(C2='122', 1, 0))>nullif(sum(iif(C2='123', 1, 0)), 0);
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 27, 2022 at 1:28 pm
STRING_AGG is not available in SQL Server 2016.
Something like this maybe
with
unq_itemno_cte(itemno) as (
select distinct itemno
from #data),
pvt_cte(itemno, string) as...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 25, 2022 at 6:24 pm
STRING_AGG is not available in SQL Server 2016.
Maybe try starting here for examples of the old way
One modern element I would add would be to use CONCAT_WS ("concat...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 25, 2022 at 5:01 pm
Obviously there's no need for nullable columns or a cursor
drop table if exists #data;
go
create table #data (
businessday ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 25, 2022 at 3:31 pm
I have gone through the two parts of Jeff's articles. But I still couldn't figure out the solution. here's my sample data:
businessday category itemno value
2022-01-01 xyz...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 24, 2022 at 11:38 pm
In which table is the 'job' column a unique key? Probably v_job_operations. The only column being SELECT'ed from v_job_operations_wc is 'workcenter'. It appears there are 3 different 'workcenter' values in...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 21, 2022 at 8:06 pm
Something I've always wondered is how is data loaded in a normalized OLTP database? One example that I think about is an ATM transaction because it captures data ranging...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 21, 2022 at 1:20 pm
Syntax-wise the CASE expressions are both missing the keyword END. Also, it's not good to enclose column labels in single quotes because although SSMS and VS have no issues with...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
January 20, 2022 at 4:27 pm
Viewing 15 posts - 481 through 495 (of 1,424 total)