Viewing 15 posts - 16 through 30 (of 367 total)
I tried the batch approach yesterday. There are over 5000 units and one unit took about 6 seconds to run. If I did this in batches of one unit at...
June 26, 2025 at 3:38 pm
this works! thank you so much!!!
I tried the query on a much larger dataset and after 4.5 hours it is still running. The dataset has about 10million records. Is there...
June 25, 2025 at 6:52 pm
I forgot to include the expected results. Sorry about that. Here you go:
June 23, 2025 at 11:27 pm
I think this is what you are looking for.
-- For each test_date, determine the last date to count in a 10 date range
; WITH DateAnalysis AS
(SELECT...
June 23, 2025 at 11:07 pm
Got data? What if you use OUTER/CROSS APPLY to retrieve the top N records? Prove it doesn't work. Provide some data.
My SQL skills are not too sharp. I am...
June 19, 2025 at 7:04 pm
Got data? What if you use OUTER/CROSS APPLY to retrieve the top N records? Prove it doesn't work. Provide some data.
np. here you go:
drop table if...
June 19, 2025 at 7:02 pm
Can you not insert a rolling 10 days window? Something along the lines of
PERCENT_RANK() OVER (PARTITION BY year ORDER BY date DESC ROWS BETWEEN 10 PRECEDING...
June 19, 2025 at 3:27 pm
ensure the file is a correctly built CSV file - if it is then you can load it using the format=CSV above - if it not then...
June 10, 2025 at 4:23 am
ensure the file is a correctly built CSV file - if it is then you can load it using the format=CSV above - if it not then get whoever...
June 9, 2025 at 3:42 pm
What if you change MAXERRORS = 0 to MAXERRORS = 1 (or whatever your upper limit is)
I tried a few values and the outcome is the same. The file...
June 9, 2025 at 3:36 pm
I came across OPENROWSET. This looks promising but I have never used it before. Can this be used for my purpose? If yes, how would I use it? I am...
June 8, 2025 at 11:15 pm
There is probably a non-printable character in it.
CREATE TABLE #DIVIDENDS_NEW
(
[DIVIDEND_AMOUNT] [varchar](15) NULL
);
insert into #DIVIDENDS_NEW select NULL;
insert into #DIVIDENDS_NEW select '5';
insert into #DIVIDENDS_NEW select CHAR(10); /* invisible...
June 5, 2025 at 3:35 pm
This is great. It works. Thank you so much!
June 4, 2025 at 11:45 pm
I re-wrote my code with an IF statement and that solved the issue.
June 2, 2025 at 4:43 am
Try/Catch blocks? https://learn.microsoft.com/en-us/sql/t-sql/language-elements/try-catch-transact-sql?view=sql-server-ver16
I clarified my original post. Not sure if you saw it or not when you replied.
I did think about TRY/CATCH but not really sure how I can...
May 24, 2025 at 4:28 am
Viewing 15 posts - 16 through 30 (of 367 total)