January 30, 2004 at 11:16 am
Hello all,
Why would you Bulk insert to a view instead of a table and what are the advantages/dissadvantages?
Thank you
January 30, 2004 at 1:38 pm
The view must be updatable. In order to make the view updatable, The view has to be created with INSTEAD OF Triggers and trigger will slow the performance in general. You also can created updated partitioned view subject to certain restrictions.
From BOL.
"If a view does not have INSTEAD OF triggers, or if it is not a partitioned view, then it is updatable only if the following conditions are satisfied:
CREATE VIEW NoTable ASSELECT GETDATE() AS CurrentDate, @@LANGUAGE AS CurrentLanguage, CURRENT_USER AS CurrentUser
INSERT, UPDATE, and DELETE statements also must meet certain qualifications before they can reference a view that is updatable, as specified in the conditions above. UPDATE and INSERT statements can reference a view only if the view is updatable and the UPDATE or INSERT statement is written so that it modifies data in only one of the base tables referenced in the FROM clause of the view. A DELETE statement can reference an updatable view only if the view references exactly one table in its FROM clause."
January 31, 2004 at 2:49 am
I usually bcp (or bulk insert) into a view when the file has fewer columns than my original table and I do not want to create a work table to receive the data or I do want to make transfornations
Bye
Gabor
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply