January 20, 2023 at 12:00 am
Comments posted to this topic are about the item Verifying Trees
January 20, 2023 at 8:52 am
Very interesting code indeed - thank you very much for this.
Some comments:
I consider this as a feature, since I cannot use @DDL to create a table using @DML to save the entries of ##tree to it.
January 21, 2023 at 11:12 pm
Hello Ruedifuchs,
Thank you for your comments.
Unless I've misunderstood comment 2) it is possible to SELECT statements in @DML that return results, eg.
DECLARE @ERROR_NUMBER INT
DECLARE @ERROR_MESSAGE VARCHAR(MAX)
DECLARE @Row_Count INT
EXEC @ERROR_NUMBER =
dbo.sp_VerifyTree
@Schema = 'dbo', -- schema of table containing tree
@Graph = 'Graph', -- table containing tree
@NodeId = 'NodeId', -- column name for NodeId in table containing tree
@Node = 'Node', -- column name for Node in table containing tree
@ParentId = 'ParentId', -- column name for ParentId in table containing tree
@DDL = '', -- DDL code to execute first (optional)
@DML = '
SELECT * FROM ##Tree
', -- DML code to execute last (optional)
@ERROR_NUMBER = @ERROR_NUMBER OUTPUT,
@ERROR_MESSAGE = @ERROR_MESSAGE OUTPUT,
@Row_Count = @Row_Count OUTPUT
SELECT @ERROR_NUMBER AS ERROR_NUMBER, @ERROR_MESSAGE AS ERROR_MESSAGE, @Row_Count AS ROW_COUNT
January 22, 2023 at 1:42 pm
This was removed by the editor as SPAM
July 1, 2023 at 5:02 am
This was removed by the editor as SPAM
May 2, 2024 at 10:55 am
This was removed by the editor as SPAM
October 29, 2024 at 9:48 am
This was removed by the editor as SPAM
December 11, 2024 at 2:42 am
This was removed by the editor as SPAM
December 11, 2024 at 2:45 am
This was removed by the editor as SPAM
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply