Viewing 15 posts - 376 through 390 (of 1,419 total)
Maybe you could add the LAG columns to #MyData. Then use a combination of LAG and MAX OVER. If this were SQL Server 2022 you could use the WINDOW clause
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 4, 2022 at 11:34 pm
Have a look at the Docs on "Multipart Names"
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 4, 2022 at 2:28 pm
The variable @ObjectName provided as an example was not plural such that it corresponds to an actual system object. Try it with N'sys.objects' instead of N'sys.object'. YOU NEED TO PROVIDE...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 4, 2022 at 12:57 pm
If it's the code in your picture which produced the error message then your probable issue imo is a type mismatch between the join columns. Either ar.S1WHS# or wf.L3WHS# is...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 4, 2022 at 1:28 am
You could try using TRY_CAST to determine which row values are causing the CAST to fail
select *
from YourTable
where TRY_CAST(MASTER_BOL_NUMBER as numeric) is null;
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 4, 2022 at 12:18 am
What about making datatype specific fnTally-ies? Many times the maximum requirement is less than BIGINT. What about fnTallySmalldatetime, fnTallyDatetime? What about making separate 0+ version and 1+ versions?
Any editorial regarding...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 31, 2022 at 2:02 pm
It's only 2 rows of data. To test with different cases I added some additional rows. Afaik you're looking to conditionally apply the sum of invoiceid credits from 'creditmemo' to...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 31, 2022 at 11:33 am
It seems you're looking for the COALESCE function. If the empty values are stored as '' then NULLIF returns NULL. COALESCE returns the first (left to right of the parameter...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 22, 2022 at 10:03 pm
To split out the pd_id's you could try STRING_SPLIT to separate based on space delimiter. Since some 'PD-[0-9]' values are encompassed by other extra characters a conditional substring is done...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 18, 2022 at 10:34 pm
Thanks to Jeff Moden in this thread for the function used here
In row 1 of the expected output from which input table does the Rnge value 45 come from? ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 18, 2022 at 2:49 pm
THAT, good Sir, is a beautiful thing! All you need to do now is give the author of that good function a little credit by citing the article where...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 14, 2022 at 2:53 pm
Afaik this actually produces the desired output. Should work with SQL 2014. It uses the ordinal splitter DelimitedSplit8K_Lead. The query: splits the input string on '_' underscore, finds the offset...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 14, 2022 at 3:17 am
Instead of a WHILE loop you could try a numbers table or tally function approach
declare @string varchar(255) = 'EMA_20210526T211254_0000_MRNMM0000001240_PMS110460PAT000001287_PID15235307_OR_Dr';
select string_agg(v.chr, '') within group (order by fn.n)...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 13, 2022 at 12:01 pm
These two statements are equivalent afaik. Beginning with [Edit] 2022 (or compatibility level 150 in Azure SQL) they added the GREATEST function. Prior ways were UNPIVOT using the built-in verb...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 12, 2022 at 5:57 pm
Is there a reason to do the Cross Apply rather than just doing the addition calculation directly in the UPDATE SET ?
The value 'calc.adjusted_minutes' is referenced twice in the...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 11, 2022 at 2:54 pm
Viewing 15 posts - 376 through 390 (of 1,419 total)