Viewing 15 posts - 2,506 through 2,520 (of 4,085 total)
J Livingston SQL (8/1/2016)
suggest you change
indexid = ROW_NUMBER() OVER (PARTITION BY [Name] ORDER BY [Name])
I was going to mention that it's pointless to use the same expression in both the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 1, 2016 at 11:56 am
Ralph L. Wahlert (8/1/2016)
If this is how I have my data flow tasks configured, see below, where would I place the error output?
Between the lookup and the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 1, 2016 at 11:18 am
michael.lock@aer.ca (7/26/2016)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 1, 2016 at 9:50 am
I haven't seen anyone mention LAST_VALUE, yet.
SELECT
mt.Applicants_ID,
mt.APPL_CURRENT_STATUS,
mt.APPL_CURRENT_STATUS_DATE,
LAST_VALUE(mt.APPL_CURRENT_STATUS) OVER(PARTITION BY mt.Applicants_ID ORDER BY mt.APPL_CURRENT_STATUS_DATE ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) AS lv
FROM #myTable mt
I use ROW_NUMBER() if I want to...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 27, 2016 at 8:32 am
Why do you think that recursion is the correct approach here? I don't think it is, because a recursive query needs to maintain the same "shape" throughout and I...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 26, 2016 at 2:31 pm
djj (7/26/2016)
Eirikur Eiriksson (7/26/2016)
Sean Lange (7/26/2016)
Jack Corbett (7/26/2016)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 26, 2016 at 2:12 pm
I think that it's possible, but it's going to be very complex, and it might just be easier to do it manually.
Here are some of the issues that you'll need...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 26, 2016 at 12:54 pm
J Livingston SQL (7/26/2016)
SELECT * FROM (
SELECT * FROM #City
UNION ALL
SELECT * FROM #Subcity) x
ORDER BY Years DESC, Citycode, subcitycode
edit....just rechecked my results.....aint...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 26, 2016 at 9:26 am
Alternatively, you could cast your DATETIME data as DATE and compare those.
WHERE CAST(DateCol AS DATE) = CAST(DATEADD(DAY, -1, GETDATE()) AS DATE)
Since CASTing from DATETIME to DATE is still SARGable, this...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 25, 2016 at 12:16 pm
As long as they are in the same transaction, changes to table A do not need to be committed in order to be available to table B. Generally, people...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 22, 2016 at 12:24 pm
fergfamster (7/22/2016)
Please bare with me, Im sure you have done this a million times. So I add the output inside the Update statement as below then I can query that...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 22, 2016 at 11:53 am
JasonClark (7/22/2016)
we can use SELECT @@IDENTITY, SELECT SCOPE_IDENTITY(), SELECT IDENT_CURRENT(‘TableName’) to get last inserted record: https://mostafaelmasry.com/2016/05/09/how-to-find-the-last-inserted-record-in-sql-server/%5B/url%5D
Since all of these methods depend on the table having an identity column, and the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 22, 2016 at 7:50 am
djj (7/21/2016)
homebrew01 (7/21/2016)
djj (7/21/2016)
Should @SQL_CMD be NVARCHAR?Do you think that would make a difference in my case ?
All our similar SP code uses VARCHAR.
I just remember that one of the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 21, 2016 at 3:21 pm
Actually, I think that the Quirky Update[/url] method might be the fastest approach to doing this. You have to be very careful to follow ALL of the rules.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 21, 2016 at 3:12 pm
That's because LAG is for a relative position. FIRST_VALUE and LAST_VALUE are for absolute positions. You do have to get a little tricky, because you need to ensure...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 21, 2016 at 3:05 pm
Viewing 15 posts - 2,506 through 2,520 (of 4,085 total)