Viewing 15 posts - 1,321 through 1,335 (of 2,648 total)
One other thing it could be is missing indexes, the additional I/O load on the disk can cause high CPU. Have you checked the activity of the disks while you...
November 15, 2019 at 12:18 pm
It can also make life easier for developers if all the primary keys are integers, it's a bit like having a design pattern that will make coding faster and more...
November 14, 2019 at 3:49 pm
Just a thought, but instead of
IF NOT EXISTS(SELECT * ... or IF EXISTS(SELECT * ... , why not use Top 1? all you need to know is only 1...
November 14, 2019 at 3:27 pm
I think you mean "surrogate" key, as there is no identity column on your table. I would use a surrogate identity column as the PK so create the table like...
November 14, 2019 at 3:23 pm
Performance Tip: The conditional behavior described for the MERGE statement works best when the two tables have a complex mixture of matching characteristics. For example, inserting a row if it doesn't...
November 14, 2019 at 2:44 pm
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
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
Viewing 15 posts - 1,321 through 1,335 (of 2,648 total)