Viewing 15 posts - 3,406 through 3,420 (of 7,614 total)
Get rid of the dashes in the date, they can cause issues.
UPDATE T_MYTABLE SET dateTransferred = '20180326 05.00.00' where id = 1223
May 7, 2018 at 3:35 pm
In any contiguous 28-day period, there will always be exactly 20 non-weekend dates and 8 weekend dates.
May 7, 2018 at 1:21 pm
May 7, 2018 at 1:19 pm
You can directly search for "Backup" "failed" messages without having to pull the entire log file first, viz:
EXEC sys.xp_readerrorlog @ArchiveID, 1, N'Backup', N'failed'
May 7, 2018 at 11:44 am
When you create a weekly job schedule in SQL, you specify "Wednesday", as in every Wednesday (or specified identified Weds of the month), but you do not list all future...
May 7, 2018 at 7:58 am
No. SQL Server itself does not store that type of info. It would be too much overhead on the system.
If the table has a unique key, you could...
May 7, 2018 at 7:55 am
I strongly prefer to avoid code that requires a specific DATEFIRST setting; my code works the same under any setting.
But this:
WHERE DatePart(dw, d)=2
adds a dependency on the...
May 4, 2018 at 3:43 pm
SELECT
passed_date, DATEADD(DAY, -DATEDIFF(DAY, 0, day7) % 7, day7) AS calcd_date
FROM (
VALUES(CAST('20180522' AS date)),('20180603'),('20180704')
) AS test_data(passed_date)
CROSS APPLY (
...
May 4, 2018 at 1:59 pm
Why the need to over-engineer everything? Each entry is, for example, "Wednesdays" not a specific Wednesday, Simple enough. Although I do agree that "Monday", "Monday" in the same row should not...
May 4, 2018 at 11:19 am
You're welcome, let me know how it goes.
Btw, it's inconsistent to use data type "datetime2" and GETDATE(), which returns only a "datetime" value. That's why I used SYSDATETIME()...
May 4, 2018 at 10:02 am
UPDATE pr
SET fieldvalue = pe.requestind,
datelstmod = SYSDATETIME()
FROM process pr
INNER JOIN person pe ON pe.personid = pr.personid AND pr.activityid = 991
WHERE...
May 3, 2018 at 12:58 pm
This a common technique ("trick") to get a single line of values from multiple lines of input. It's almost always at least a pair of conditions, e.g.:
MAX(CASE WHEN rline...
May 3, 2018 at 12:40 pm
May 3, 2018 at 12:33 pm
May 3, 2018 at 12:31 pm
Viewing 15 posts - 3,406 through 3,420 (of 7,614 total)