Viewing 15 posts - 601 through 615 (of 6,678 total)
It sounds to me that you're making backups to the same file all the time and the backup sets are stacking up in the same file. Either assign different...
April 19, 2022 at 8:30 pm
There is a problem here that needs to be addressed. The code you have for the end of the month will return the last day of the month - at...
April 19, 2022 at 8:20 pm
I think I would start here:
There is no need to concatenate the variables into your code. That is SQL Injection at it's finest. Use the variables as parameters.
Also,...
April 19, 2022 at 8:06 pm
You need to pass something to export-cdv
$matched_itrms | Export-Csv ...
April 14, 2022 at 2:51 pm
I completely missed the different years - so change the where clause to:
WHERE Balance > 0
OR (last_modified_date >= '20210401' AND last_modified_date < '20220401')
So if the item has...
April 12, 2022 at 5:30 pm
Yes, case is important. You can use -ilike I think.
April 12, 2022 at 4:19 pm
How about:
SELECT A , B , C ...
From Table_A
WHERE ( last_modified_date between '01/04/2021 00:00:00' and '31/03/2022 23:59:59' )
OR ( balance > 0 and last_modified_date NOT...
April 11, 2022 at 5:38 pm
So you are actually looking in each file for matching strings in the contents of the file. Okay - the same general principle applies....
April 11, 2022 at 4:01 pm
Cost Threshold for Parallelism = 5
Max Degree of Parallelism = 12
Are these values correct?
Definitely not for the first one. Bump that up to at least 40:
EXEC...
April 10, 2022 at 5:05 pm
If you use a SAN, check the SAN documentation for a "SAN Snapshot". It's almost instantaneous.
Which will not work for an AOAG unfortunately. To add a database to an...
April 10, 2022 at 4:48 pm
For multiple servers\locations - define those in a separate file. Then - get the contents of that file and loop...
$match_array = @("failed","error");
$fileLocations = Get-Content "\\somelocation\somewhere\ListOfFolders.txt"
$fileLocations | %...
April 10, 2022 at 4:36 pm
Use s CTE or derived table
March 13, 2022 at 10:41 pm
The LAG function can be simplified - no need to use ISNULL if you use the following:
, Numdays = DATEDIFF(dd, LAG(d.[End],...
March 11, 2022 at 7:50 pm
...
SELECT SUBSTRING(V.YourString,CI4.CI+1, CI5.CI - CI4.CI - 1)
FROM (VALUES('Data:A:B:C:20:0:0'))V(YourString)
CROSS APPLY (VALUES(CHARINDEX(':',V.YourString)))CI1(CI)
CROSS APPLY (VALUES(CHARINDEX(':',V.YourString,CI1.CI+1)))CI2(CI)
...
March 7, 2022 at 8:28 pm
Viewing 15 posts - 601 through 615 (of 6,678 total)