Unanswered: Regarding SQL1476N The current transaction was rolled back because of error "-1477".
I have a created a table wiht NOT LOGGED INITIALLY option.
I have a SQL stored procedure which will alter the table with ACTIVATE NOT LOGGED INITIALLY and does insertion.and COMMIT after inserting all the records.But the exception "SQL1476N The current transaction was rolled back because of error "-1477"." is getting raised and No record is getting inserted into the table.
1) Can't ALTER table with NOT LOGGED INITIALLY from stored procedure?
2) Why the table is becoming in accessible after calling the stored procedure?
3) How to rectify the above problem?
The cause of error is clear: A table was being created with the NOT LOGGED INITIALLY option. During the same unit of work, an error occurred. This unit of work is rolled back, and any table that was created in it is dropped. This is what the code description says.
As a rule of thumb do not provide any DDLs (ALTER in your case) as part of the application programs (Stored Procedures). I dont understand the need for altering the table and commiting everytime.. Is that absolutely necessary
Thanks Gajendran.The problem is ,I can not execute import from stored procedure.I have to call external proceudre in sql stored procedure to invoke import utility which I don't want to do.