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.
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!
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.