Viewing 15 posts - 601 through 615 (of 2,644 total)
Jonathan AC Roberts wrote:It will even answer Jeff's primary interview question correctly:
Actually, that's just the first part of the answer that I expect. 😀
But I'm sure it got further than some...
January 4, 2023 at 5:46 pm
I thought I'd ask my new found tech ChatGPT this question, if there is anyone who hasn't tried it they should, it even knows a bit of...
January 4, 2023 at 5:26 pm
Except for the occasional Indexed View, this is one of the many reasons why I hate views.
Instead, try a "parameterized inline view" better known as an "Inline Table Valued...
January 4, 2023 at 1:23 am
This will identify rows that don't match:
SELECT [D1].[RowID] AS [D1_RowID],
[D1].[PairID] AS [D1_PairID],
[D1].[SequenceInt] AS...
January 1, 2023 at 2:37 am
Is this solution is only good if there are no dates falling on weekends?
what mention of weekends? there is nothing on the original OP post that mentions it...
December 31, 2022 at 4:31 pm
Is this solution is only good if there are no dates falling on weekends?
December 31, 2022 at 11:26 am
@frederico_fonseca I had the same idea as you initially, but your solution will not work either. What if there were 20 groups instead of 3? What if the gaps...
December 30, 2022 at 6:40 pm
I think the query can be simplified to this:
SELECT @RowCount = COUNT(*)
FROM Quality q (NOLOCK)
WHERE (q.Quality_Date <= DATEADD(DAY, @Interval,GETDATE())
...
December 30, 2022 at 5:30 pm
This is probably the fastest code but a bit long winded
declare @Delimiter char(1) = '/'
;with cte as
(
select 'Invoice/14/248/TD C/O BGIS/20009. 1/ 16566/JB App...
December 30, 2022 at 5:09 pm
Also convert '12/31/9999' to a proper date-type for comparison
In Belgium this would read as the 12th of month 31 in the year 9999
In the UK too
December 30, 2022 at 10:18 am
Got it.
select 'LOAD DATA INFILE ''db/'+name+'.txt'' INTO TABLE '+name+'('+STRING_AGG(COLUMN_NAME,',')+');'
from tbl_column_length C left join sysobjects S on C.TABLE_NAME=S.name
where type='u'
and length <100
and name in('table1')
group by name
That...
December 27, 2022 at 10:38 pm
Definitely use char(2) for the values, as suggested (varchar requires two bytes of extra overhead (to store length) per column).
If they're not already encoded, encode the names. That is,...
December 26, 2022 at 8:02 pm
I think I would resort to the RBAR cursor method:
DROP TABLE IF EXISTS #Results;
CREATE TABLE #Results(Score int, ActivationTime datetime, Grp int, BaseDate date)
DECLARE @Score int, @ActivationTime datetime
DECLARE...
December 26, 2022 at 3:35 pm
Yes and the Value field is varchar(02), it needs to hold "1", "2", or "NA".
It would save 2/3rds of the memory required if it could be...
December 25, 2022 at 11:17 pm
Yes and the Value field is varchar(02), it needs to hold "1", "2", or "NA".
It would save 2/3rds of the memory required if it could be a numeric...
December 25, 2022 at 12:12 am
Viewing 15 posts - 601 through 615 (of 2,644 total)