Viewing 15 posts - 6,751 through 6,765 (of 59,102 total)
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
I have a Use case like.
We migrated around 1000 millions of rows into around 5-6 tables.
client requirement frequently change to update some columns. Is there any best way to...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 21, 2020 at 11:20 pm
So I am trying to get the datediff for parameters selected, even though the 2 dates could span 60 days, for an example I have 2 dates available(2018-01-05 11:08:00)...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 21, 2020 at 11:17 pm
Congratulations on the improvement you made but I don't believe your job is complete yet. My biggest concern would be to find out exactly why a single package is consuming...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 21, 2020 at 11:12 pm
There is a job that runs every 2 hours, it grabs the last 10k records, truncates and loads those records back with fresh new IDs.
To what end? What is...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 21, 2020 at 11:08 pm
Viewing 15 posts - 6,751 through 6,765 (of 59,102 total)