Package SQL Create Record - Get Information

More
11 months 2 weeks ago #25490 by prashant
Hellos,

Any ideas here will be appreiciated, I am sure I am missing something in my design structure

In a package I am creating SQL record , using a script , this table has contains a simple identity which is a running primark key 
 

Once a record is created, the logs obviously dont' show the ID of the record created since the value (cannot be passed on)
 

How do you propose I ideintify the record , since I need to pass it to a webhook 

Please Log in or Create an account to join the conversation.

More
11 months 2 weeks ago #25491 by prashant
CHATGPT suggested something like below , but the output is still not 'captured'

INSERT INTO [items].[basecamp].[delegation] (
    task,
    RelatedDirector
)
OUTPUT INSERTED.ID
VALUES (
    'hello',
    'again'
)
 

Please Log in or Create an account to join the conversation.

More
11 months 2 weeks ago #25493 by Peter.Jonson
Good morning

What is your database type?

Can you provide us with table creation script please and insert statement

Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
11 months 2 weeks ago #25495 by prashant
Hi,

This is MS - SQL 2022. Please find SQL dump

 
 

File Attachment:

File Name: delegation.txt
File Size:2 KB


I am updating it like below
Code:
UPDATE [basecamp].[delegation] SET bc_taskid = #basecamp_taskid#, eventid=NULL WHERE ID = #ID#;
The following user(s) said Thank You: Peter.Jonson

Please Log in or Create an account to join the conversation.

More
11 months 2 weeks ago #25497 by Peter.Jonson
Instead of SQL Script you can use SQL Record to get value

Here is the script

BEGIN
DECLARE @NewIDTable TABLE (ID INT);
INSERT INTO [delegation] (
    task,
    RelatedDirector
)
OUTPUT INSERTED.ID INTO @NewIDTable
VALUES (
    'hello',
    'again'
)
SELECT ID FROM @NewIDTable;
END


Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
11 months 2 weeks ago #25501 by prashant

Instead of SQL Script you can use SQL Record to get value
 
You guys always have an ACE up your sleeve !

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save