Viewing 15 posts - 6,736 through 6,750 (of 59,091 total)
This just sounds like the basic skill required for properly documenting any code but slightly extended. The comments should explain the What and Why. You can read the code for...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 23, 2020 at 3:28 pm
Enquiring minds want to know... where the hell did the OP go?
And, yeah... I'm a poet and don't know it. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 8:01 pm
No, the plan for a procedures, functions, ... when then execution cache is not big enough to hold all the plans - do you have a server that can...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 5:28 pm
That's really not helpful at all.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 5:25 pm
Wouldn't it be easier to take a snapshot of sys.dm_db_index_usage_stats from one day till the next and do a comparison? The added benefit here is that it includes...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 5:53 am
Hi,
Please refer below code snippet -
;WITH DateTable AS (
SELECT * FROM (VALUES
('2020-07-01',0,0),
('2020-07-02',0,0),
('2020-07-03',0,1),
('2020-07-04',1,0),
('2020-07-05',1,0),
('2020-07-06',0,0),
('2020-07-07',0,0),
('2020-07-08',0,0)
) AS t(DateValue,isWeekEnd,isHoliday)
),
TicketTable AS (
SELECT * FROM (VALUES
('Ticket1','2020-07-01','2020-07-06'),
('Ticket2','2020-07-07','2020-07-08'),
('Ticket3','2020-07-07',NULL)
) AS t(Ticket,CreateDate,ResolvedDate)
)
SELECT t.Ticket,t.CreateDate,t.ResolvedDate,
DATEDIFF(DAY,t.CreateDate,t.ResolvedDate) - SUM(d.isWeekEnd)-SUM(d.isHoliday)...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 5:49 am
Yes, I was also thinking from a maintenance perspective dynamic would not be the best solution. Today its 3 missing, it might be 5 in the future so adding...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 5:15 am
You said that the files that are missing columns are the same except for the missing columns. With that in mind, it's a whole lot easier if you make...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 5:12 am
You said that the files that are missing columns are the same except for the missing columns. With that in mind, it's a whole lot easier if you make multiple...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 5:11 am
Here's my attempt:
;with TestData as
(
SELECT *
FROM (VALUES ('A[kfg]'),
...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 1:46 am
Not sure if i read it correctly but look into STRING_AGG or STRING_SPLIT
Got code?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 12:28 am
In addition to Jeff's good comments, another (and in my own opinion better) solution would be to normalize the table and split that column into a completely different table,...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 12:26 am
Hi Friends,
I have a table which has DateTime, IsWeekend, IsHoliday fields in my DB.
I have another table which has the list of tickets logged with columns like
Select TicketID, Status,CreatedDate,ResolvedDate,...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 12:17 am
Hi,
Please refer below code snippet -
;WITH DateTable AS (
SELECT * FROM (VALUES
('2020-07-01',0,0),
('2020-07-02',0,0),
('2020-07-03',0,1),
('2020-07-04',1,0),
('2020-07-05',1,0),
('2020-07-06',0,0),
('2020-07-07',0,0),
('2020-07-08',0,0)
) AS t(DateValue,isWeekEnd,isHoliday)
),
TicketTable AS (
SELECT * FROM (VALUES
('Ticket1','2020-07-01','2020-07-06'),
('Ticket2','2020-07-07','2020-07-08'),
('Ticket3','2020-07-07',NULL)
) AS t(Ticket,CreateDate,ResolvedDate)
)
SELECT t.Ticket,t.CreateDate,t.ResolvedDate,
DATEDIFF(DAY,t.CreateDate,t.ResolvedDate) - SUM(d.isWeekEnd)-SUM(d.isHoliday) AS TicketAge...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2020 at 12:15 am
Have you actually check what code is running on the server during this problem?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 21, 2020 at 11:43 pm
Viewing 15 posts - 6,736 through 6,750 (of 59,091 total)