Viewing 15 posts - 2,491 through 2,505 (of 8,731 total)
Here are the 2 options I mentioned earlier. The recursive CTE has the advantage of returning the results in a single query. The set-based loop (in my experience) is usually...
July 18, 2016 at 2:05 pm
This is easily achievable with a recursive CTE or a set-based loop[/url]. The issue is that you mention that C doesn't have a parent, but it has one on the...
July 18, 2016 at 1:19 pm
lsalih (7/18/2016)
Meantime may I ask you how you run two CMDSHELL commands in the same transaction. Do...
July 18, 2016 at 12:11 pm
lsalih (7/18/2016)
No, I do not. In such case how you stop two services within TSQL script.
Transactions are made to handle changes in the database within a certain connection. Stopping/Starting services...
July 18, 2016 at 12:04 pm
I didn't remember this when you first posted your problem, but have you tried using SQL#? It has Replace functions that might help you.
July 18, 2016 at 11:57 am
Do you realize that xp_cmdshell is not affected by explicit transactions?
July 18, 2016 at 11:50 am
Ed Wagner (7/18/2016)
HappyGeek (7/18/2016)
Ed Wagner (7/18/2016)
Revenant (7/18/2016)
crookj (7/18/2016)
whereisSQL? (7/18/2016)
djj (7/18/2016)
Revenant (7/15/2016)
Luis Cazares (7/15/2016)
HappyGeek (7/15/2016)
Ed Wagner (7/15/2016)
Luis Cazares (7/15/2016)
Ed Wagner (7/15/2016)
Grumpy DBA (7/15/2016)
Ray K (7/14/2016)
crookj (7/14/2016)
Manic Star (7/14/2016)
PikachuBless you
Gesundheit
Health
System
Broken
Bureaucracy
Gone mad!!
Fell in...
July 18, 2016 at 11:16 am
This could give you an idea.
SELECT *
INTO #SampleData
FROM(
SELECT 123456, 789, 'N' UNION ALL
SELECT 123456, 789, 'N' UNION ALL
...
July 18, 2016 at 9:37 am
HappyGeek (7/15/2016)
Ed Wagner (7/15/2016)
Luis Cazares (7/15/2016)
Ed Wagner (7/15/2016)
Grumpy DBA (7/15/2016)
Ray K (7/14/2016)
crookj (7/14/2016)
Manic Star (7/14/2016)
PikachuBless you
Gesundheit
Health
System
Broken
Bureaucracy
Gone mad!!
Fell in love
July 15, 2016 at 2:02 pm
itortu (7/15/2016)
can the second sp be called from within the first sp?
Yes, but that's not the point.
You'll delete once and insert multiple times. That's the way to call them from...
July 15, 2016 at 1:02 pm
Then maybe, you should create one stored procedure to delete and one to insert.
If you'll always have an array that will have the rows that must remain stored, then you...
July 15, 2016 at 12:03 pm
Why not use MERGE to do an UPSERT and forget about deleting rows? Just insert or update depending on if a row exists or not.
Or if you don't want to...
July 15, 2016 at 11:41 am
Jabba1963 (7/15/2016)
The good news is that I had already adopted the windows partitioning approach as you suggested - so good to know I was heading...
July 15, 2016 at 8:06 am
Ed Wagner (7/15/2016)
Grumpy DBA (7/15/2016)
Ray K (7/14/2016)
crookj (7/14/2016)
Manic Star (7/14/2016)
PikachuBless you
Gesundheit
Health
System
Broken
July 15, 2016 at 7:07 am
Y.B. (7/14/2016)
What you originally proposed isn't that complicated...
I suggest that you follow the link I posted. There's a similar version of your code which runs about 4 times slower than...
July 14, 2016 at 1:25 pm
Viewing 15 posts - 2,491 through 2,505 (of 8,731 total)