hi experts,
I'm working on a simple stored proc to copy a tables' records to a table in another database.
Because there are 2 million rows to be copied, I want to drop the indexes in the destination database, perform the Insert, then create the indexes again.
In a stored procedure in the source database....
DROP INDEX Reporting.dbo.Claims.IX_Claims_1
get "Error 166: DROP INDEX does not allow specifying the database name as a prefix to the object name"
I can schedule a separate Job to drop the indexes just prior to the other Job that does the copy.... is there an easier way to do everything within 1 procedure ?
Thanks, John
I'm working on a simple stored proc to copy a tables' records to a table in another database.
Because there are 2 million rows to be copied, I want to drop the indexes in the destination database, perform the Insert, then create the indexes again.
In a stored procedure in the source database....
DROP INDEX Reporting.dbo.Claims.IX_Claims_1
get "Error 166: DROP INDEX does not allow specifying the database name as a prefix to the object name"
I can schedule a separate Job to drop the indexes just prior to the other Job that does the copy.... is there an easier way to do everything within 1 procedure ?
Thanks, John