Viewing 15 posts - 736 through 750 (of 2,645 total)
You can do it with a cursor which can be faster if you a purchasing a large number of products:
IF OBJECT_ID (N'tempdb..#TEMP1', N'U') IS NOT NULL DROP...
April 23, 2022 at 4:10 pm
;with cte as
(
select sum(t.price) over (order by t.price asc, v.N) RunningTotal, *
from #TEMP1 t
...
April 23, 2022 at 1:40 am
;with cte as
(
select sum(t.price) over (order by t.price asc, v.N asc) RunningTotal, *
from #TEMP1 t
...
April 22, 2022 at 8:18 pm
Create two temporary tables which are copies of D and S but with the additional columns of [O_NAME_04_NOT_NULL], [O_NAME_05_NOT_NULL], [O_NAME_06_NOT_NULL] , then add a clustered index on the name columns.
e.g....
April 3, 2022 at 11:54 am
With the understanding that I don't use Analysis Services, can you use T-SQL in SSAS? There are some very fast methods for calculating MEDIAN in T-SQL.
You can query SSAS...
April 1, 2022 at 3:47 pm
Hi Jonathan,
Thanks for the input. I would like to know if there is any implications/perf issues of using MERGE statement especially when dealing large sets of data?
I've found replacing...
March 30, 2022 at 11:54 am
Have you looked at the execution plan? Maybe you should paste all the code in this thread.
March 29, 2022 at 9:22 pm
Jonathan,
There is no problem with the UPDATE. All indexes are created. Moreover, tables #SecuritiesClass and #SecuritiesClassRules only contain 3 records. By putting GETDATE() before and after the UPDATE, I...
March 29, 2022 at 9:02 pm
If the MERGE statement is just updating or inserting then change it to be an update statement followed by an insert where not exists statement.
March 29, 2022 at 7:13 pm
Hi Ken,
For your knowledge, this is the actual statement that triggers the problem:
UPDATE SC
SET
SC.QuickEffectiveDate = SCR.EffectiveDate,
SC.QuickNominalValueChangeTypeID = SCR.NominalValueChangeTypeID,
SC.QuickHasRightToVote =...
March 29, 2022 at 7:07 pm
what a solution ..is there any easiest way to do this just want to have capital word after space
I've done the difficult bit for you (writing the function) I...
March 24, 2022 at 7:54 pm
Create this function
CREATE FUNCTION dbo.TitleCase
(
@String nvarchar(MAX)
)
RETURNS nvarchar(MAX)
AS
BEGIN
RETURN stuff(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(
replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(
lower(@String),' A','...
March 24, 2022 at 5:14 pm
SELECT *
FROM ParentTable p
OUTER APPLY(SELECT TOP(1) *
FROM ChildTable c
...
March 17, 2022 at 7:58 pm
Just like to say congratulations to Jeff for reaching 1 million points:
March 16, 2022 at 6:02 pm
I assume, therefore, that none of your reports aren't already in an SSRS project? If so, how are the existing reports maintained? What happens when someone asks for a...
March 11, 2022 at 3:52 pm
Viewing 15 posts - 736 through 750 (of 2,645 total)