Viewing 15 posts - 151 through 165 (of 1,489 total)
While not clear, it seems as though you have a database in FULL recovery which has not had a log back in 3 or 4 years. The log file must...
March 6, 2024 at 3:59 pm
I would look at dynamic sql as well.
DECLARE @FilterId int = 4;
WITH CityTypes
AS
(
SELECT City, [State], CityType
FROM dbo.SampleData S
...
March 6, 2024 at 1:01 pm
-- Create a login with a strong password
CREATE LOGIN [NewUser] WITH PASSWORD = 'StR0nG_p@ssW0rd!';
I am not sure SQL Server authentication represents best practice but I suspect it...
March 1, 2024 at 1:39 pm
We had a cyber incident (sic) late last year and it was actually our ISP who picked up the problem. I doubt AI was involved as I think they found...
February 28, 2024 at 7:40 pm
If your databases are only being backed up to Veeam, I presume you are automating test restores from Veeam and running DBCC CHECKDB...
February 24, 2024 at 9:49 pm
SELECT n_type
,COUNT(1) AS Total
,SUM(IIF(d_type = 'a_type', 1, 0)) AS a_type
,SUM(IIF(d_type = 'b_type', 1, 0)) AS b_type
,SUM(IIF(d_type = 'x_type', 1, 0)) AS x_type
FROM @temp
GROUP BY n_type
ORDER BY n_type;
January 30, 2024 at 8:22 am
Ken's code is nice, but theoretically I believe it could yield a false positive if the previous month happened to be 13 months prior to the current month. For...
January 11, 2024 at 8:01 pm
WITH MonthCheck
AS
(
SELECT mainhost, enter_date
,IIF(MONTH(enter_date) - 1
...
January 11, 2024 at 10:11 am
Looking at this again the following is probably better:
WITH cte_Employee (EmployeeId, EmploymentTypeId, DateId)
AS
(
SELECT EmployeeId, EmploymentTypeId, DateId
FROM
...
January 9, 2024 at 5:13 pm
You would make your life easier if you stored dates as dates. This is an Islands and Gaps problem. One solution:
WITH cte_Employee (EmployeeId, EmploymentTypeId, DateId)
AS
(
...
January 9, 2024 at 3:51 pm
but I don't know how to replicate that in SQL.
Run Ed B's code.
In future, provide a test rig and test answers before answering. If you do not know how...
December 21, 2023 at 4:57 pm
I prefer migrations but have used in-place upgrades to buy time until there are the resources to look at a more managed upgrade. The trick is to have lots of...
December 20, 2023 at 10:28 am
I'll try to answer the questions all in one post here.
December 12, 2023 at 5:38 pm
Viewing 15 posts - 151 through 165 (of 1,489 total)