Viewing 15 posts - 5,236 through 5,250 (of 13,879 total)
Some additional advice.
Add SET NOCOUNT ON.
I suggest you use DATE datatypes rather than DATETIME.
Use a temp table rather than a table variable – they usually perform better.
August 25, 2017 at 11:40 am
August 25, 2017 at 7:59 am
WITH summed
AS
(
SELECT
td.Chunk
, NewChunk = SUM(IIF(td.LineNum = 1, 1, 0)) OVER (ORDER BY td.recid
ROWS UNBOUNDED PRECEDING
)
FROM #tempData td
August 25, 2017 at 7:21 am
August 24, 2017 at 2:12 pm
August 24, 2017 at 2:10 pm
August 24, 2017 at 1:41 pm
August 24, 2017 at 12:13 pm
Secondly, Phil is wrong that you need a join. What you should be doing is updating the table through the CTE.
Damn it, why do I always forget this...
August 24, 2017 at 11:51 am
August 24, 2017 at 11:08 am
Can you get the required data using [msdb].[dbo].[sysssispackages] .
Please help to get the required o/p
SELECT...
August 24, 2017 at 7:13 am
August 24, 2017 at 7:10 am
I have 3000 rows of address data in a single field called Address.
The actual...
August 24, 2017 at 6:00 am
The UPDATE statement is this bit:WITH Ordered
AS
(
SELECT
t.Id
, rn = ROW_NUMBER() OVER (ORDER BY t.Dsc)
FROM...
August 24, 2017 at 5:57 am
You need to join back to your subquery on the table's PK or unique key. Here is an example:
CREATE TABLE #test1
(
Id INT...
August 24, 2017 at 5:43 am
August 24, 2017 at 5:23 am
Viewing 15 posts - 5,236 through 5,250 (of 13,879 total)