Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How export view without data in DTS Export Wizard 1

Status
Not open for further replies.

pwills

Technical User
Sep 14, 2002
54
GB
It strikes me as odd that when you do a standard export SQL Server wants to copy the DATA within the views.

All I want are the data in the TABLES and the view definitions.

Anyone know why you would ever want to actually export the data created by the views?
 
Views can be used for many different processes. One of these is for security purposes. Within the view you can limit exposure of data and provide only necessary columns to the user. This is where you allow exporting through view the data. Another purpose of a view is you can handle the relationship within a view for many tables and then provide the final output for exporting. For example, you have a student table, a grade table, and set up a view of student grades. You could set up access to only allow certain rows (say for a particular teacher) using that view. When the teacher request the data through the view, the teacher would only get his students and their grades. This is a basic example, but it show why you would want to export data within a view.

Hope this helps.
 
I'm not sure why it would strike you as odd, the main purpose of DTS is to import/export data. If you just want to send the structure to another database, create a script and run it on the other database.
 
Problem with script:
It prefixes the table owner. The new database doesn't have the same user, for the very reason that DTS Export changes the table owner to dbo

While on the subject, is it possible to script the table triggers?
 
Yes you can script the triggers. You can also change the script to put in who you want as owner. However, it is preferred for management reasons to have dbo as the owner of everything anyway. As a policy, I don't allow anyone to create an object in a database with any owner other than dbo. If someone does by accident, I change it immediately and then yell at them. No one has ever done it twice!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top