Viewing 15 posts - 1,321 through 1,335 (of 2,645 total)
All of that is why people are interested in the performance... those are improvements that a lot of people would like.
I found some code someone else has written to...
November 12, 2019 at 11:36 pm
Yes, it can retrieve partially updated records and if a page-split is happening it can return duplicate rows.
Best to only be used on data that is not being updated and...
November 12, 2019 at 5:41 pm
Does it make difference if I do 'Select 1 instead of Select * in each EXISTS(...... subquery?
or Select Top 1 ...
It makes no difference.
November 12, 2019 at 5:17 pm
That's pretty interesting. Looks somewhat similar to Eirikur's but a few differences. The one thing I am not a fan of is that it has the same major miss...
November 12, 2019 at 3:25 pm
You can rewrite the SQL as this:
IF EXISTS(SELECT *
FROM #GRatings
...
November 12, 2019 at 1:33 pm
Just break up the statement so you are adding to @SQLSTRING several times.
SET @SQLSTRING = N';WITH CTE AS ' +
...
November 12, 2019 at 12:49 pm
You could try this STRING_SPLIT function I'm in the process of writing and give me some feedback.
It's like SQL Server's STRING_SPLIT function but will work with SQL 2012 and...
November 11, 2019 at 5:26 pm
I wouldn't increase the amount of memory you give to SQL Server, 29GB out of 32GB is already quite high. You need to leave enough memory for the operating system...
November 11, 2019 at 4:58 pm
Your query would be more efficient if you used a cursor to select distinct ref_nr_vertrag from table tbl_111_aed2_umhaengen_Verträge. Like this:
DECLARE @Vertrag AS int= 1
DECLARE @myCursor cursor
SET @myCursor...
November 11, 2019 at 2:07 pm
If you have an index on the table:
DECLARE @Planning_Proposal_Temp TABLE (object varchar(10), dateFrom datetime2, dateTo datetime2
...
November 9, 2019 at 12:11 pm
I think it can be done with a recursive CTE:
;WITH rCTE AS
(
SELECT a.object,
...
November 8, 2019 at 12:40 pm
I'm not sure what you are trying to do, but COUNT(MyDateField) will count the not null MyDateField values.
Or are you trying to do do something else like COUNT(DISTINCT CONVERT(varchar, MyDateField, 112))...
November 8, 2019 at 1:13 am
Another method:
;WITH CTE AS
(
SELECT t.VisitID,
MAX(t.ActivityDateTime) MaxActivityDateTime
...
November 7, 2019 at 4:02 pm
Here's a simple method to do that:
SELECT year1a.get_customeVal_1-year1b.get_customeVal_2 AS get_customeVal_3,
year2a.get_customeVal_1-year2b.get_customeVal_2 AS get_customeVal_4
FROM (SELECT 1 X) X
CROSS APPLY(SELECT...
November 7, 2019 at 3:46 pm
Have you tried setting the fetchsize to the number of rows you are expecting from the query?
November 7, 2019 at 3:19 pm
Viewing 15 posts - 1,321 through 1,335 (of 2,645 total)