Viewing 15 posts - 4,111 through 4,125 (of 8,731 total)
I'm not sure if this is a good idea:
WITH rCTE AS(
SELECT s.saleid, u.userid, b.businessunitid, b.name, b.parentbusinessunitid, 1 AS n
from ...
September 25, 2015 at 8:26 am
jkramprakash (9/25/2015)
Thank you
You're welcome.
However, do you understand the solutions?
September 25, 2015 at 7:52 am
You make it very difficult to help you. You only post a part of your code which doesn't seem to require a cursor or recursive query at all.
You might...
September 25, 2015 at 7:37 am
mw112009 (9/24/2015)
Beleive me, the LEFT OUTER JOIN is faster.I deal with large tables and the "EXITS" make the query run for hours..
Are we supposed to take your word for granted...
September 25, 2015 at 6:54 am
jasona.work (9/25/2015)
Grant Fritchey (9/25/2015)
jasona.work (9/25/2015)
Hmm. Maybe we need to Godwin that topic, and bring in a comparison somehow...
September 25, 2015 at 6:42 am
Kristen-173977 (9/24/2015)
Vic Rauch-303403 (9/24/2015)
CONVERT(varchar,
I recommend that you don't rely on the default size for varchar, there is some strange behaviour which will catch you out from time to time.
I use...
September 24, 2015 at 2:04 pm
Use a CASE statement.
CREATE TABLE #Milestonetable(
JobNo INT,
MileStoneName CHAR(1),
ForecastDate DATE,
ActualDate DATE,
...
September 24, 2015 at 1:31 pm
shorton2 (9/24/2015)
Any way to tell where I'm getting this warning from:Warning: Null value is eliminated by an aggregate or other SET operation.
That comes from all the MAX() functions. Nothing to...
September 24, 2015 at 1:17 pm
Or avoid the JOINs.
WITH CTE AS
(
SELECT id, num, COUNT(*) OVER(PARTITION BY id, num) dup_cnt
FROM @t
)
DELETE c
--SELECT *
FROM cte...
September 24, 2015 at 1:06 pm
Remember that SELECT INTO will create a new table each time. To add the INTO clause, just include it before the FROM as you would with a normal query. You...
September 24, 2015 at 12:54 pm
GilaMonster (9/24/2015)
Alan.B (9/24/2015)
Just as a side note, this won't fail:
WITH X AS(
SELECT fld
FROM #t
WHERE cast(fld as int) > 0
)
SELECT fld
FROM X
WHERE ISNUMERIC(fld) =1
Since the optimiser pushes predicates down...
September 24, 2015 at 11:53 am
T-SQL is a declarative language, which means that you're not telling the engine how to process the query, you just tell it what you want it to do. That means...
September 24, 2015 at 10:57 am
That's the way to do it. However, if you're hard coding the milestones, there's no reason to use the dynamic code. But that's the place where you would filter either...
September 24, 2015 at 10:49 am
If you can query the specific milestones, you can limit them.
September 24, 2015 at 10:36 am
Viewing 15 posts - 4,111 through 4,125 (of 8,731 total)