Hi all,
I’m trying to get a return value after my query has ran and ive tried using the parameters but its not working any and all help will be thanked
SELECT SCOPE_IDENTITY() AS and i cant find how to get it.
Hi all,
I’m trying to get a return value after my query has ran and ive tried using the parameters but its not working any and all help will be thanked
SELECT SCOPE_IDENTITY() AS and i cant find how to get it.
Hi @trogers ,
Execute Query:
Executes a query on a database and returns the query result in a Datatable.
you have to pass Datatable variable in the Output parameter.
Activities - Execute Query (uipath.com)
If you are using Execute Non Query:
Executes an non query statement on a database. For UPDATE , INSERT , and DELETE statements, the return value is the number of rows affected by the command. For all other types of statements, the return value is -1.
you have to pass the Int variable in the Output parameter.
@trogers ,
You can use the Execute Query activity in combination with the Output Data property.
Hi ,
First first use connect to database activity and then use the Execute Query activity with correct parameters, this will give you Output Datatable.
Cheers
Well i have it coming out now but not correctly. i had to use the Output data table activity and now its converting it to text and i need it as a numeric value.
So use CDbl or CInt depending on your needs.
Cint(yourStringValue) converts to integer, CDbl(yourStringValue) converts to double (ie decimal).
Thank you what i had to do was
" + Text variable .Replace(“RecId”,“”) +"

dtReturn.Rows[0][0].ToString()
This will give you the SCOPE_IDENTITY() value
Note : below is the query
Insert into <table_name> values (value1, value2); SELECT SCOPE_IDENTITY();