Viewing 15 posts - 631 through 645 (of 2,645 total)
No, a solution like this is hopefully only on few rows - as mentioned earlier, else change the way to solve the problem. And if my solution runs in...
December 19, 2022 at 8:50 pm
And if you want the seven last?
And if your server is performing like a dog because you have implemented the most inefficient code you can think of?
December 19, 2022 at 8:32 pm
For me, the following priority is important and my priority - so we will never agree! 1. The statement returns the correct result with the current data. 2. The...
December 19, 2022 at 8:27 pm
Just as a comparison of the methods given I ran the following script for 130k rows:
-- Finding second last
DROP TABLE IF EXISTS #Tmp ;
create table #Tmp (SerialNumber...
December 19, 2022 at 6:57 pm
If the optimizer choose to use tempdb, data is not necessary read in the same order as inserted - the principle of using a heap. In this situation with...
December 19, 2022 at 4:15 pm
If the optimizer choose to use tempdb, data is not necessary read in the same order as inserted - the principle of using a heap. In this situation with...
December 19, 2022 at 1:06 pm
This is not correct! It is right that there is no sort, but no sort is not the same as data is in the same order as in the...
December 19, 2022 at 9:48 am
AC Roberts: you are making one of the classic mistakes!!! You just use a function without testing for a correct solution. ORDER BY (SELECT NULL) does not guarantee order....
December 19, 2022 at 12:21 am
Here is a solution to get the value before the last pipe symbol, it will work on SQL Server 2012 or higher using this function: https://www.sqlservercentral.com/scripts/a-varcharmax-string_split-function-for-sql-2012-and-above-2, it...
December 18, 2022 at 3:52 pm
The new STRING_SPLIT with the 3rd operand is great for this. The old STRING_SPLIT without it is not. Even MS has stated that the order of the output is...
December 16, 2022 at 6:20 pm
As a test I used this date range function https://www.sqlservercentral.com/scripts/a-daterange-table-valued-function to insert 6.3M rows into a temporary table to see which is faster. There doesn't seem to be lot...
December 14, 2022 at 1:13 am
Guys... the OP doesn't know which domains contain a "B" ahead of time. He was just explaining the desired results for the test data he provided. Or, at least,...
December 8, 2022 at 1:53 am
Or slightly more concisely
DECLARE @JobDomain int
SET @JobDomain = 1
SELECT *
FROM dbo.TestTable
WHERE JobDomain = @JobDomain
AND (TestType = 'B'
...
December 8, 2022 at 1:40 am
DROP TABLE IF EXISTS #T;
SELECT *
INTO #T
FROM (VALUES ('1A','E'),('1A','IR'),('1A','N'),('1A','SC'),('1A','SCIR'),
...
December 6, 2022 at 5:58 pm
You could insert all the data that needs to be updated into a temporary table with a clustered index on BaseId, also as Scott says make sure the clustered index...
December 6, 2022 at 4:27 pm
Viewing 15 posts - 631 through 645 (of 2,645 total)