436
Views
3
Comments
[BulkInsert] Getting error while using bulk insert  for outsystems table (Using physical name)
Question
bulkinsert
Service icon
Forge asset by Galter

BulkInsert: System.InvalidOperationException: Cannot access destination table 'OSUSR_qy5_TEST'. ---> System.Data.SqlClient.SqlException: Invalid object name 'OSUSR_qy5_TEST'.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

2024-04-02 13-23-43
Gonçalo Ferraria
Champion

Hi Rocky,


Probably you have the table in a diferent SCHEMA (Catalog). Try specify the catalog before the table name. 

2021-06-03 11-03-21
Anubhav Rai

Hi Rocky,

Open manage dependency and follow the steps given in below screenshot then click on apply.
then you can use this aggregate in your flow by using existing  table name in the filter then you will get entity ID and use this ID with getentity().entity.Physical_Table_Name in the table name input of the Bulkinsert action.

2018-05-11 10-51-15
Tiago Reis

Hello.

I am trying to use this to insert on the User_Role System Entity and I get the same error described on this question.

Can someone help?

The error is the following:


BulkInsert: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: DestinationTableName
at System.Data.SqlClient.SqlBulkCopy.set_DestinationTableName(String value)
   at OutSystems.NssBulkInsert.CssBulkInsert.SqlServerBulkInsert(IOSList recordList, String tableName, String columnsToIgnore, String referenceColumns, Boolean useTableLock, Dictionary`2 recordFields, String Catalog, String ExternalDatabaseConnectionName)


I used this a lot already in entities that are not system entities... Is it diferent?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.