Viewing 15 posts - 2,161 through 2,175 (of 4,085 total)
I agree with most of what Jeff said, but I would TRUNCATE the tables rather than scripting, dropping, and recreating them.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 17, 2016 at 9:37 am
krypto69 (11/17/2016)
I need the maxThis seems to work :
SELECT * FROM [SQLNODEBSTAGE].[PEC_PROD].[DBO].[Staging_Eligibility]
WHERE (select max(staging_eligibility_id) FROM [SQLNODEBSTAGE].[PEC_PROD].[DBO].[Staging_Eligibility]) <> (SELECT MAX(staging_eligibility_id) FROM [SQLNODEBSTAGE].[STAGING_Archive].[DBO].[Staging_Eligibility_archive])
I agree with the others that...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 17, 2016 at 9:34 am
These types of functions are best left to the presentation layer.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 16, 2016 at 2:28 pm
Isn't this essentially the same question that you had in Recursive CTE performance improvement. You received an answer to this question there.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 14, 2016 at 9:50 am
The most obvious explanation is that the NULL value is coming from some other part of the UNION. Does the first column value match the value in this part...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 11, 2016 at 9:48 am
Reported as s-p-a-m.
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 10, 2016 at 9:41 am
There are three main ways.
1) The key is included in the source data.
2) Use the OUTPUT clause when you INSERT/MERGE the data into the user record to get the ID...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 9, 2016 at 2:53 pm
BowlOfCereal (11/8/2016)
drew.allen (11/7/2016)
SELECT m.origval, n.comp_val
FROM #mytab m
CROSS APPLY (
SELECT...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 8, 2016 at 2:19 pm
The files are processed in alphabetical order. If you follow the naming convention of having a fixed filename prefix with a timestamp suffix in YYYYMMDDHHMMSS order they will be...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 8, 2016 at 8:50 am
Gary Varga (11/7/2016)
I would recommend avoid using RTFM. If someone gets offended it can become an HR nightmare.
Just tell them it means Read the FABULOUS Manual. 😀
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 7, 2016 at 2:01 pm
Since you want the final result as a numeric value, it doesn't make sense to manipulate the string. Try the following:
SELECT m.origval, n.comp_val
FROM #mytab m
CROSS APPLY (
SELECT TOP (1)...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 7, 2016 at 1:14 pm
TheSQLGuru (11/4/2016)
Well done Drew. Especially nice given the added flexibility. 2 very minor improvements:
Thanks. I did consider including the first improvement, but decided to go with the less efficient...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
November 4, 2016 at 9:55 am
Viewing 15 posts - 2,161 through 2,175 (of 4,085 total)