Viewing 15 posts - 616 through 630 (of 7,608 total)
Select custnbr
from #plist
group by custnbr
having sum(case when prlist like 'pli%' then 1 else 0 end) = 1 and
sum(case when prlist like '[ac]b%'...
October 6, 2022 at 2:08 pm
Do you mean you can't use a SEQUENCE? I can't imagine why. I use those all the time when for whatever reason an identity is not appropriate. And there's a...
October 6, 2022 at 2:04 pm
First I would think would be to try this:
GRANT SELECT ON dbo.view_name TO [domain\account];
GRANT SELECT ON dbo.view_name2 ...
October 5, 2022 at 4:03 pm
Use a table to store the date ranges, then join to that.
DROP TABLE IF EXISTS #DATES;
CREATE TABLE #DATES (
VARIABLEA date NOT NULL,
...
October 5, 2022 at 3:03 pm
You're also going to need to do something about the:
ar.Account_B__c as Account_ID,
a.SalesOrg__c as SalesOrg,
columns. They are not in the GROUP BY and they are not within an aggregate function, so...
October 5, 2022 at 2:28 pm
Best would be not to shrink the main db at all. If possible, add a secondary filegroup, create the temp tables in there, then shrink only the file(s) in that...
October 3, 2022 at 6:23 pm
You're good there, so that's not part of the issue.
October 3, 2022 at 5:52 pm
Are you on the latest CU(patch-level)?
Have you verified that the threshold for parallelism setting is not too low?
October 3, 2022 at 3:37 pm
Btw, neither "matched" nor "user_id" are SQL Server reserved keywords.
September 29, 2022 at 11:09 pm
A trigger makes the most sense to me, so that the assignments are immediate. You would also need a DELETE trigger to remove interested / mutual for a deleted user_id...
September 29, 2022 at 11:08 pm
Btw, as noted by some others, I too, fortunately, have never seen any automated tool that can really properly analyze index usage and make really good suggestions for changes. You...
September 29, 2022 at 9:08 pm
SQL already captures the vast bulk of the stats you need, thus you don't generally have to set up separate runs, etc. to capture activity.
If you're willing to run the...
September 29, 2022 at 9:03 pm
DECLARE @EndDate date
DECLARE @StartDate date
SET @StartDate = '20220101' --<<-- change @Start and @End values to get any date range you want
--get end of current month
SET @EndDate =...
September 26, 2022 at 4:40 pm
Btw, you should always specify nullability (NULL / NOT NULL) when ADDing a column, otherwise it's extremely difficult to determine what you'll get there.
September 23, 2022 at 2:27 pm
To get the last datetime for a given set of datetimes, you'd typically use ROW_NUMBER(), like this:
select ...
From (
select *, row_numnber() over(partition by...
September 22, 2022 at 3:56 pm
Viewing 15 posts - 616 through 630 (of 7,608 total)