Viewing 15 posts - 691 through 705 (of 7,608 total)
DECLARE @email_min_date_to_keep datetime;
/* only delete email older than 7 days; change the -7 to whatever number of days you prefer before running */
SET @email_min_date_to_keep = DATEADD(DAY, -7, CAST(GETDATE() AS date))
EXEC...
August 5, 2022 at 5:33 pm
Review sysmail_event_log to get additional info on the error(s) that occurred in mail.
Sometimes you also want to look at sysmail_faileditems but that likely won't be helpful for the type of...
August 5, 2022 at 3:15 pm
Drop the existing index.
Assuming that the column is datetime and not just time, create a clustered index on the datetime column.
It would be better to use datetime2 type to reduce...
August 5, 2022 at 3:58 am
Maybe try:
EXEC msdb.dbo.sysmail_delete_mailitems_sp
August 4, 2022 at 6:30 pm
No problem. Let me know if you need help on getting the correct job_id to add to the sysjobhistory table.
August 4, 2022 at 4:51 pm
You can't restore an older version msdb over another msdb anyway, no matter what.
You could, however, restore the msdb db to a different db name (e.g. msdb_old).
I think you could...
August 4, 2022 at 4:21 pm
It doesn't. You're wayyyy over-analyzing this. Again, it's a simple q with a simple answer. Save the big analysis for a more significant q.
August 3, 2022 at 9:28 pm
select T.*, T2.VAL
from @T T
outer apply (
select top (1) t2.*
from @T t2
where t2.ID <= T.ID and
t2.VAL is not null
order by t2.ID desc
) as T2
August 3, 2022 at 9:26 pm
2. If the value is a date only, use a date data type, period.
August 3, 2022 at 6:06 pm
Who says? It didn't specify anything about the table. Consider it to be "most convenient". 😀
The OP said:
you want to search for all users who have an email "@gmail"'
The...
August 3, 2022 at 2:01 pm
SELECT [FIRST_THREE_WORDS] = LEFT(ADDRESS + ' ', CHARINDEX(' ', ADDRESS + ' ', CHARINDEX(' ', ADDRESS, CHARINDEX(' ', ADDRESS + ' ', 0)+1)+1))
FROM ( SELECT '123 Main Street' ) AS...
August 2, 2022 at 9:08 pm
That is a simple q, I say give it a simple answer. There's no need to over-analyze every q or nit pick its wording.
You're missing the point, Scott. ...
August 2, 2022 at 8:44 pm
That is a simple q, I say give it a simple answer. There's no need to over-analyze every q or nit pick its wording. Of course interview qs don't contain...
August 2, 2022 at 3:41 pm
If there's any possibility that the NOT IN column checked can be NULL, then you need to explicitly exclude NULL(s). It doesn't sound like it could be NULL for this...
August 2, 2022 at 2:58 pm
Naturally b is the answer to that specific question.
As to why:
(1) the table has 1M rows; therefore, creating an index with only the columns you need will typically drastically cut...
August 2, 2022 at 2:51 pm
Viewing 15 posts - 691 through 705 (of 7,608 total)