Hi Everyone
I am new to UiPath, still learning various activities and it’s applications. Faced an issue while dealing with DB and database, please help me with the same…
I have a MS SQL Server DB which contains a table ‘Robotdb’ with column ‘ID’ as primary key. Bot must update this DB with a Data table ‘dtSample’ containing exactly identical column structure. Requirement is to update DB with only new entries in Primary Key column ‘ID’. Can this be done using a Single Non Query. I tried the below code but getting this error -
Message - The table type parameter dtSample must have a valid type name
Exception Type - Argument Exception
Code -
“INSERT INTO Database.dbo.Robotdb SELECT * FROM @dtSample S WHERE NOT EXISTS (SELECT 1 FROM Database.dbo.Robotrpa R WHERE S.ID = R.ID)”
This query when executed in MS SQL Server with 2 tables from the DB itself, it works.
Tried searching in existing threads but could not identify a solution. Kindly advise how to pass the datatable as a parameter correctly in the above query.
Thank you…