Viewing 15 posts - 61 through 75 (of 668 total)
144 million reads and 70 million reads??!! How many rows are returned? Have you looked at the execution plan? This hits allresults twice, so doing rowcount twice
SELECT results.*,
(SELECT Count(*)
FROM...
November 23, 2020 at 2:25 pm
can you provide DDL and sample data to help. If they have multiple addresses but the same acct_id, then you can do something like
select Acct_id, count(1) from my_table group by...
November 13, 2020 at 1:56 pm
sounds like the volume has increased and they need to be rebuilt more often
November 4, 2020 at 9:22 pm
I would look here too
(convert(varchar, dateadd(hour, -6, sk.CreationDate),0) between @StartDate and @EndDate)
why converting dates to varchar? This will not use an index. I see @StartDate and @EndDate, but don't know...
November 4, 2020 at 7:40 pm
what is the compatibility level of the db?
November 3, 2020 at 7:13 pm
I think you're going to need a master proc that has this logic or SSIS. Then the proc could call the procedure 4 times and pass in the TransactionIDs that...
October 26, 2020 at 7:43 pm
If you provide DDL, samples data and expected results, we can help. Not sure what you have and what you are looking for in your description
October 26, 2020 at 1:43 pm
why would you need extra field in the join? Shouldn't the primary key and Record Source be enough?
Target.[HistoryDataPrimaryKey] = Source.[HistoryDataPrimaryKey] AND --
Target.RecordSource = Source.RecordSource AND
then
when matched and Target.LastSeenDate > @LastSeenDate...
October 21, 2020 at 6:04 pm
You can put it in a variable. Just not sure why you would need the NotExists part. What are you trying to accomplish? I don't know how you would get...
October 20, 2020 at 2:29 pm
Your SQL look right, but we don't have your data set, so it's hard to troubleshoot
Create table #t (ListDesc varchar(20), WeekOfMonth int, RecordCount int, MonthYearOf varchar(20))
insert into #t values
('EXP_PKG_1',1,100, 'April...
October 19, 2020 at 6:42 pm
Is it going to be impossible to discuss without sample data? If so, let me know and I will create a spreadsheet. If you have a test data generator...
October 14, 2020 at 3:10 pm
do you have any sample data and expected results?
October 14, 2020 at 2:17 pm
Please provide DDL and sample data. Pictures are great, but we cannot readily consume them to help with your query
October 14, 2020 at 1:45 pm
Your example works because it can convert it to Decimal (32,6). It rounded the last value. The try convert will return null if it can't convert it. ...
October 6, 2020 at 7:28 pm
Not sure what the question is. If these files are saved from the end user, and they probably will be, then if they receive more than 1 day, they have...
October 5, 2020 at 8:02 pm
Viewing 15 posts - 61 through 75 (of 668 total)