Viewing 15 posts - 3,016 through 3,030 (of 4,087 total)
I realized late yesterday that my query needed some updates. With the sample data that was posted, I was able to update the script and get something that worked.
;
WITH...
June 19, 2015 at 10:13 am
Without test data, it's hard to say, but I believe that this query will give you the same results, while being MUCH, MUCH simpler. I'm guessing it will also...
June 18, 2015 at 2:56 pm
Isn't this the same question that you asked before?
http://www.sqlservercentral.com/Forums/Topic1693743-3077-1.aspx
Drew
June 18, 2015 at 12:10 pm
I'm guessing the problem is with the BETWEEN on your datetime field in the WHERE clause. There are a number of issues with using BETWEEN with datetime data. ...
June 18, 2015 at 7:06 am
codykonior (6/16/2015)
And you don't need two temporary tables when one will do.
You don't need any temporary tables at all. The temporary tables just add unnecessary overhead.
DECLARE @Row_Batch INT =...
June 17, 2015 at 8:13 am
j.grimanis (6/16/2015)
I do not want to confuse people, especially when they are trying o help me.
Below is a sample of how stored procedure seems :
PROC1
-----Procedure1 is calling...
June 17, 2015 at 7:45 am
Try moving your variable declarations/assignments outside of your TRY/CATCH blocks. I'm guessing that the behavior of variable assignments in TRY/CATCH blocks is different between the two versions of SQL...
June 15, 2015 at 2:24 pm
sgmunson (6/15/2015)Also, just as a general rule, almost no one uses RIGHT joins because it's just not intuitive.
I've actually wondered about this. I know this is true of left-to-right...
June 15, 2015 at 7:45 am
You simply have to join to the table twice with different aliases, which is essentially what you were doing by creating two CTEs.
select o.ID, o.OrderNumber, s.MarketCenterCity AS 'SourceMKT', d.MarketCenterCity AS...
June 12, 2015 at 10:17 am
Shadab Shah (6/11/2015)
Below is the error
Msg 4108, Level 15, State 1, Line 2Windowed functions can only appear in the SELECT or ORDER BY clauses.
The way to get around this is...
June 12, 2015 at 7:39 am
Yes, it is possible, but I have never done it. You'll need to use the built-in Dynamic Management Views (DMV), specifically sys.dm_exec_requests which gives you information about currently running...
June 12, 2015 at 7:24 am
ScottPletcher (6/11/2015)
June 11, 2015 at 3:26 pm
Luis Cazares (6/11/2015)
When doing such strong and conclusive statements, you should show proof of that.
You're right, of course.
I can't give a conclusive statement even after some testing that shows that...
June 11, 2015 at 3:17 pm
Luis Cazares (6/11/2015)
koles2004 (6/11/2015)
I wanna specify: the second your variant is faster than first ?
I can't assure that it's faster or better. The only way to ensure that is by...
June 11, 2015 at 1:57 pm
sqlinterset (6/11/2015)
I would like to display NULL.
Then you will need to add a CASE statement like so
;
WITH complaints_ordered AS
(
SELECT
Fiscal_Week,
Complaint_Num AS c1,
CASE WHEN LAG(Fiscal_Year) OVER(PARTITION BY Fiscal_Week ORDER BY Fiscal_Year) =...
June 11, 2015 at 1:47 pm
Viewing 15 posts - 3,016 through 3,030 (of 4,087 total)