Grooper 21.00.0070 is available as of 3-21-2023! Check the Downloads Discussion for the release notes and to get the latest version.
External SQl table update From Grooper
Hello!
I see that there is a SQL export activity step available. However, Is there any sql update activity step available as well for external SQL database? If not I would like to write an update statement within task process step and how should I start with? Please advise.
Thank you.
0
Answers
Dim CurFolder As BatchFolder = CurNode
Dim dc As DataConnection = DataConnection
Dim Settings As SqlConnectionSettings = dc.ConnectionSettings()
Dim db As SqlDatabase = New SqlDatabase(Settings)
If (db.Connect() = False) Then Throw New Exception("Unable to connect to the database.")
Dim comm As New SqlClient.SqlCommand()
db.ExecuteNonQuery("exec " & _StoredProcedureName, "")
db.Disconnect()
End Sub
Define a new table 'eg GrooperInsert' that Grooper inserts into using Database Export.
Define a trigger on the new table for inserts. In the trigger update the table(s) you want to update.
This way you can do complex lookups and updates based on a simple Grooper insert statement.
CREATE TRIGGER [dbo].[GrooperInsert_INSERT]
**** Add your lookups/updates here ****
END
You can download it here:
https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
If you are unsure of how to do this, then I would recommend talking to your company's Database Base Administrator (DBA).