Viewing 15 posts - 676 through 690 (of 7,597 total)
To flip 0/1 and vice versa:
UPDATE dbo.table_name SET column = ABS(column - 1)
August 16, 2022 at 1:23 pm
Create a unique clustered index on ( TNR_DATE, GSN_ID ). You can still have a nonclustered PK on GSN_ID alone.
and how will the OP create a non clustered...
August 8, 2022 at 4:43 pm
Create a unique clustered index on ( TNR_DATE, GSN_ID ). You can still have a nonclustered PK on GSN_ID alone.
August 8, 2022 at 2:05 pm
If you prefer, just point the old name to the new table; you can, and definitely should, still continue to clean up the old name after that, but it should...
August 5, 2022 at 5:35 pm
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
Viewing 15 posts - 676 through 690 (of 7,597 total)