Viewing 15 posts - 1,141 through 1,155 (of 2,645 total)
I'm not sure that all the answers given in this thread are correct?
The WHERE clause, if indented, looks like this:
WHERE 1 = CASE WHEN T.record_Key_4 = '1'...
February 7, 2020 at 4:31 pm
before you ask... you do not want to see the query plan...
Now you've said that, we want to see the query plan.
February 7, 2020 at 3:41 pm
;with A(A) as (select 0 from (values (0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) A(A))
select row_number() over (order by (select null)) ID,
o.quantity,
...
February 6, 2020 at 7:41 pm
This is not as fast as Jeff's method but is a more straight forward way of writing the SQL:
SELECT *
FROM #RMmaster m
WHERE...
February 6, 2020 at 8:55 am
Then how would i calculate the number of loops?
I thought it would be something like [TotalNumberOfRecords] MOD 100000?
Also when i write this value to a SSIS variable, how do...
February 4, 2020 at 11:42 pm
Thanks, Mike. I am also from the UK.
When I Googled 'chad', I ended up learning a lot about a country in Africa, but nothing about hole-punch waste! 🙂
https://en.wikipedia.org/wiki/Hole_punch#Multiple_hole_punches
Most...
February 4, 2020 at 2:45 pm
Jonathan AC Roberts, that's a very good point.
I'm currently Unit testing Phil Parkin's solution, which fits my brief and is elegant to boot.
Thanks for looking.
Giles
Personally I'd just leave it...
February 4, 2020 at 2:27 pm
Why are you outputting this line, whatever the error?
PRINT 'Attempt to insert duplicate PK in dbo.PersonWithUnviewedAlerts';
What if it's caught due to a different error?
February 4, 2020 at 1:46 pm
Looks ok to me. I would only do it with dynamic SQL if the list of tables is going to change. If they are fixed then just hard code an...
February 3, 2020 at 2:25 pm
You could insert the results from each query into a temporary table, then query the temporary table:
CREATE TABLE #Temp
(
TableName sysname NOT NULL
...
February 1, 2020 at 8:05 pm
From the limited information you have provided in your question and the error message I would guess that column PROCSTATUS_NUM is not a numeric data type (maybe it's character?) and...
February 1, 2020 at 6:31 pm
Put it in a common table expression and subtract it in a select from the CTE.
;WITH CTE AS
(
SELECT Count(*) AS 'Count of Tranactions',
...
January 31, 2020 at 5:13 pm
Not sure I can answer your question but we used to have some SQL Server instances running on VMs, each server was running on a dedicated machine with just one...
January 31, 2020 at 1:44 pm
too late!
January 30, 2020 at 3:58 pm
Here's another way of doing it using cross applys to work through the backslashes:
SELECT i.Result, a.line
FROM DATACONTENT a
CROSS APPLY(VALUES (SUBSTRING(a.line,CHARINDEX('\',a.line,3)+1,8000))) b(line)
CROSS APPLY(VALUES (SUBSTRING(b.line,CHARINDEX('\',b.line)+1,8000)))...
January 30, 2020 at 1:41 pm
Viewing 15 posts - 1,141 through 1,155 (of 2,645 total)