Copying Data To or From a View

Administering SQL Server

Administering SQL Server

Copying Data To or From a View

Data can be bulk copied to or from a view. This includes copying data from multiple joined tables, adding a WHERE clause, or performing special formatting, such as changing data formats using the CONVERT function. For example, to bulk copy data from the view titleview in the pubs database to the Titleview.txt data file, execute at the command prompt:

bcp pubs..titleview out titleview.txt -c -Sservername -Usa -Ppassword

To bulk copy data into a view using bcp or the BULK INSERT statement, the rules for inserting data into a view apply.

Note  When data is bulk copied into a view, NULL values will be inserted even if a default value is defined for the field.

See Also

Modifying Data Through a View