With multiple insert statements. ANSI SQL syntax is
INSERT INTO table_name VALUES ......
Consequently, there is only accomodation for one table per statement.
If you have a complex view, it may be possible to insert into the view and let the system figure out which columns go where, but this depends on (a) your RDBMS and (b) how your view/tables are structured.
As mentioned by carp, you can insert into multiple tables using a view. HOWEVER, you need to make sure that all the fields that are not nulls in any of the tables used in the view are mentioned in the select statement, otherwise the insert will fail. Also, you must make sure that you have write privilages into the relevant databases that the select refers to, or it will fail.
Finally, you need to check if there are any triggers attached to any of the tables, and if so, that you have specified all the information that these may require...to top all that off, check for potential deadlock conflicts, to the trigger using a table you have also used in the view.....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.