The following example uses a view of the HumanResources.DepartmentView table of the AdventureWorks sample database. From a query tool such as SQL Server Management Studio Query Editor, execute:
CREATE VIEW DepartmentView AS
SELECT DepartmentID, Name, GroupName
FROM HumanResources.Department;
GO
The following command bulk exports the data from the DepartmentView view into the DepartmentView.txt data file. At the Microsoft Windows command prompt, enter:
bcp AdventureWorks..DepartmentView out DepartmentView.txt -c -T
To delete this sample view, execute the following Transact-SQL statement:
DROP VIEW DepartmentView;
GO