Import/Export | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive


Freinds & veterans, I have a small problem.
when i transfer tables and views from a database to another database through import/export wizard i get all the views and tables into the tables folder . can someone tell me how to transfer views to the views folder ? As i am a novice to this field, pls execuse me if my question is more basic . BTW, are there any sites for SQL DBA starters? Thanx
Create script of views and run the script in another database. Madhu
thanx ,but that takes alot of time if there are many views? how can we do it thru import/export wizard or in one go?
you can export all tables and views in one go. Within Import/ Export Window, when you are at "Select Source table and Views" PAge then you’ll see 3 columns "Source" , "Destination", "Mapping" Underneath mapping columns, there is a option to edit and then you can edit the path of the destination folder, where you want to transfer the data. Cheers
quote:Originally posted by chetana thanx ,but that takes alot of time if there are many views? how can we do it thru import/export wizard or in one go?

you can create script for all the view in one go (a) Right Button on Database
(b) Tasks
(c) Generate Scripts
(b) select database name and select only Views after creating this script , run it in target database. Madhu

run the following script to get the script of all views… you copy and run in any db or server… SELECT OBJECT_DEFINITION (OBJECT_ID )
quote:BTW, are there any sites for SQL DBA starters?
There is no such site for starters, you can take you time to refer through the SQL books online and review the posts in this forum to get more understanding, also avoids time to post multiple (duplicate) threads. The reason for behaviour of showing VIews in table folder is nothing but
quote: A view is a virtual table whose contents are defined by a query. Like a real table, a view consists of a set of named columns and rows of data. Unless indexed, a view does not exist as a stored set of data values in a database. The rows and columns of data come from tables referenced in the query defining the view and are produced dynamically when the view is referenced.
and on the destination database once you have to started creating the views they will be stored in the Views folder, it is the presentation layer than a problem. Follow as suggested above to script them, which is a recommended method. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
This posting is provided AS IS with no rights for the sake of knowledge sharing. The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind.