Skip to content

Commit d517971

Browse files
committed
Ensure a @TopicID is returned from GetTopicID()
The `GetTopicID()` function returns the `@TopicID` corresponding to a given `@TopicKey`. The only problem? If it isn't able to find the `@TopicID` then it doesn't return a value—which causes downstream implementors to falter when trying to consumer the output. To mitigate that, we're now returning a default of `-1`.
1 parent 5138dea commit d517971

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

OnTopic.Data.Sql.Database/Functions/GetTopicID.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ BEGIN
1919
-- DECLARE AND DEFINE VARIABLES
2020
------------------------------------------------------------------------------------------------------------------------------
2121
DECLARE @TopicID INT
22+
SET @TopicID = -1
2223

2324
------------------------------------------------------------------------------------------------------------------------------
2425
-- GET TOPIC ID BASED ON TOPIC KEY

0 commit comments

Comments
 (0)