Viewing 15 posts - 1 through 15 (of 26 total)
Yes, but I have to go to my DBA to make these kind of changes and it is not easy with our DBA. With CTE, I can do it myself.
May 9, 2013 at 8:34 am
Thanks Sean. It is just what is required.
One more request:
I am new to CTE.
Do you have a CTE that will delete all the children when the parent is deleted automatically?...
May 9, 2013 at 8:24 am
Yes, the objective is to delete orphan records but in the example UnitID 1's record should not be deleted as their heirarchy is correct. You could have unit...
May 9, 2013 at 8:02 am
Sorry, the select in the middle of code should be replaced by DELETE as follows:
--===== If the test table already exists, drop it
IF OBJECT_ID('TempDB..#tblUnit','U') IS...
May 9, 2013 at 7:41 am
Thanks!
This does not work the way I want to.
Also, I have an additional issue to consider and that is: All ParentIDs begin at 0 so they will not have...
May 9, 2013 at 7:37 am
This is the script to create records in table:
--===== If the test table already exists, drop it
IF OBJECT_ID('TempDB..#tblUnit','U') IS NOT NULL
...
May 9, 2013 at 6:49 am
Sorry. I was just trying to show the relationship between records. Can you give an example of recursive cte to do this?
May 9, 2013 at 6:42 am
Thanks but it does not do what I want to do. The query shows null End_Date and null EndDates. As I am only trying to capture records that changed (End_date...
May 9, 2012 at 10:09 am
Thanks.
I already have a date in a different column and I trying to calculate the number of minutes worked by an employee on a given date. I have...
February 2, 2011 at 10:07 am
Viewing 15 posts - 1 through 15 (of 26 total)