Viewing 15 posts - 1 through 15 (of 6,743 total)
EXEC msdb.dbo.sp_update_job @job_name='<your_job_name>', @enabled = 0 /* to disable, or 1 to enable */
May 13, 2022 at 8:22 pm
You're not going to be able to this calculation:
ISRECNUM % 20 = 5
sargable. By definition, it just isn't.
May 13, 2022 at 1:54 pm
Actually, the development team should have nothing to do with how the data in the db is physically stored. That's the DBA's job. (Sorry, just...
May 13, 2022 at 1:41 am
Absolutely correct. McAfee could end up damaging your db files, esp. log files.
May 13, 2022 at 1:32 am
I suggest using a table to simplify the calcs:
;WITH test_data AS (
SELECT CAST('08/31/2021' AS date) AS [Period date], CAST('07/31/2022' AS date) AS [target...
May 13, 2022 at 1:29 am
Actually, the development team should have nothing to do with how the data in the db is physically stored. That's the DBA's job. (Sorry, just had to...
May 12, 2022 at 4:45 pm
I suggest using SUM rather than COUNT. THEN 1 ELSE 0 is a consistent, clean pattern, whereas THEN 1 ELSE NULL is a kludge.
,SUM(CASE WHEN tc.IsEnabled =...
May 12, 2022 at 3:34 pm
Could you post directly usable data -- CREATE TABLE and INSERT statement(s) -- rather than just a picture? We can't write SQL against a picture :-).
May 12, 2022 at 3:30 pm
You don't need to use variables. I also suggest sticking to the "best practice" technique for getting a specific date value.
An index would be best on ( asis, twdatum );...
May 12, 2022 at 3:25 pm
Actually, the development team should have nothing to do with how the data in the db is physically stored. That's the DBA's job. (Sorry, just had to say that first.)
I'll...
May 11, 2022 at 7:26 pm
If you don't need to worry about possible blank chars in the data, you can remove the trimming. I did it just as a safeguard.
;WITH test_data AS...
May 11, 2022 at 2:49 pm
SELECT ca.*
FROM dbo.your_table_name
CROSS APPLY (
SELECT Sector, 2023 AS Period, [2023] AS Value
UNION ALL
SELECT Sector, 2024,...
May 11, 2022 at 2:37 pm
Check to see if the tool has some type of api or other interface that will let you get the SQL from the tool itself.
May 5, 2022 at 6:31 pm
SELECT *,
SUM(tran_in - tran_out) OVER(PARTITION BY account_id ORDER BY Year_cal, Month_Cal
ROWS BETWEEN UNBOUNDED PRECEDING...
May 5, 2022 at 3:29 pm
... ,PercentOfWhole = CONVERT(DECIMAL(3,1),StatusCount*100.0/SUM(StatusCount) OVER ()) ...
I believe you want decimal(4, 1) rather than (3, 1) (at least I can't see any reason why 100% of one group might...
May 4, 2022 at 5:39 pm
Viewing 15 posts - 1 through 15 (of 6,743 total)