Viewing 15 posts - 2,341 through 2,355 (of 2,610 total)
The CROSS APPLY with the TOP(1) requires multiple scans of the table, whereas the...
July 24, 2018 at 8:08 am
This is an example of the XOR swap algorithm:
https://en.wikipedia.org/wiki/XOR_swap_algorithm
July 24, 2018 at 5:26 am
July 24, 2018 at 5:22 am
Another method of getting the result you want is to use CROSS APPLY with TOP(1)::;WITH CTE AS (select distinct Id from CustomerSourceDE)
SELECT T.* FROM CTE
CROSS...
July 24, 2018 at 4:27 am
July 24, 2018 at 4:18 am
Sounds like you need to create some dynamic SQL.
There are a few articles on this:
https://www.mssqltips.com/sqlservertip/2783/script-to-create-dynamic-pivot-queries-in-sql-server/
https://stackoverflow.com/questions/10404348/sql-server-dynamic-pivot-query
https://social.technet.microsoft.com/wiki/contents/articles/39000.sql-script-convert-rows-to-columns-using-dynamic-pivot-in-sql-server.aspx
July 23, 2018 at 10:45 am
Rows per batch should be set to the total number of rows on the table.
Set the table lock checkbox on the staging table
Set the maximum insert commit size...
July 23, 2018 at 10:15 am
You can create a DOS batch file that calls the .vbs file with cscript command
https://ss64.com/vb/cscript.html
July 23, 2018 at 7:13 am
June 19, 2018 at 7:11 am
I just tried your query with 0.5 million in MyTable and 30 million in MyAudit. And it ran in 8 seconds on my work desktop. Maybe you need better hardware?
June 19, 2018 at 7:04 am
SELECT a.SQLInstance,
a.DBName,
Max(a.SvcStartDate) as MaxSvcStartDate,
Sum(a.DaysUpTime) as SumDaysUptime
FROM #tbla a
WHERE NOT EXISTS(SELECT *
FROM #tbla b
WHERE b.Used=1...
June 19, 2018 at 5:52 am
I suspect you need an index on one of the tables to improve the query performance.
You really need to work out which queries within the set of queries is...
June 14, 2018 at 8:42 am
Another way of writing the query:;WITH DS AS
(
SELECT DISTINCT
DS.DateKey,
DS.SafeRegionKey,
DS.Attribute3ValueKey
FROM rstore.OutputDataset...
May 17, 2018 at 6:23 am
Another way of doing it:;with myTable AS
(
SELECT *
FROM (
VALUES (1,'B-6916','SEOK'),
(2,'B-6916','SEOK'),
(3,'B-6916','SEOK'),
(4,'B-6916','SEOK'),
(5,'B-6916','SEOK'),
(6,'B-6916','SEOK'),
(7,'B-6916','NEOK'),
(8,'B-6916','NEOK'),
(9,'B-6916','SEOK'),
(10,'B-6916','SEOK'),
(11,'B-6916','SEOK')
) V(ID,...
May 17, 2018 at 5:39 am
May 4, 2018 at 8:18 am
Viewing 15 posts - 2,341 through 2,355 (of 2,610 total)