Before importing data into a table 24x7 retrieves that table definition and checks whether the current user has dbo role or owns the table. If yes, it checks if that table has a primary key or unique index. If you cannot alias that user to dbo you can the following workaround: Create a table in the user's schema. Import into that table and then move data to the main dbo table. If the database has "builb insert/select into" option enabled you don't event need a permanent table you can use the following technique DatabaseExecute("SELECT * INTO #temp FROM dbo.e_table_name WHERE 0 = 1", rows) DatabaseExecute("CREATE unique index i ON #temp(column names here)", rows) DatabaseImport("#temp", "c:\\temp\\file_name.csv", rows) DatabaseExecute("INSERT INTO dbo.e_table_name SELECT * FROM #temp", rows) DatabaseExecute("DROP TABLE #temp", rows) : Yes, : this table owned by dbo : and I tried different way that you described below and it did not work. : and also I delete rows from the script: ConcatEx "delete : db_name..e_table_name where client in ('MM','C_MM') and bus_date = : '", bus_date, "'", query : DatabaseExecute(query, rows) : This script works fine. : -Gennadiy
|