Using SSIS to copy objects - views won't copy
HiMy web host recently upgraded my dbs from sql 2k to 2008. Because it is on a shared server, they disabled the Backup Database option, for security reasons, both on the old 2k setup and on the new 2008 one. This didn't matter on 2k, because I could use DTS to copy all my objects and leave this scheduled to run at night. It does matter with 2008 as DTS is gone!As a web developer, I like to keep a local copy of my db on my development machine. This also served as my backup. With 2k DTS I just had a saved (& scheduled) package which copied views and tables, overwriting the local copy with the new remote data and recreating all the tables' default values, primary keys, identity seeds and so on. It even copied over the object permissions. Just what I needed. Perfect working copies of the whole database.My host now advises me to use the Import/Export Data function to backup, but this is hopeless - by design. It only copies data, not any of the schema details, no default values, no permissions. It takes ages to get my local copy back in to shape if you use this option. If you include views, this process doesn't copy the view definition, instead it creates a table from the view and imports that!I read in various posts that you can use Business Intelligence Development Studio to design an Integration Services project which will do what DTS used to do using its wizard. I've used the package designer to create a package, set it to copy the tables I want and also copy the views and stored procedures, I've set it to copy Schema, user logins, object specific permissionsand AllDRIObjects = True and discovered that:It copied all tables fine, complete with default values etcIt didn't copy any viewsIt didn't copy any SPsIt didn't copy user loginsIt didn't copy object permissionsI've tinkered with the settings - but although it is set to do these things, it just doesn't.I've created new project which is only supposed to copy all views. That runs perfectly happily, gives no error messages but stubbornly refuses to copy any views!What am I doing wrong?Any help gratefully received!ThanksTim P
May 1st, 2009 2:58pm

Can you confirm that you are on SQL 2008 as well?on your host do you have your own instance or your own database?Are you using the "transfer SQL server object Task" ?and you have set "copy all views" set to true?
Free Windows Admin Tool Kit Click here and download it now
May 1st, 2009 4:35pm

Hi AlunThanks for the reply.Yes, I am on SQL Server 2008 Developer Edition. Updated today to SP1.On my host I have my own database but not my own host.I am using the Transfer SQL Server object task and CopyAllViews has been set both to true and to false with the views I want selected - I tried it both ways. Didn't work either way.RegardsTim
May 1st, 2009 8:46pm

I can't quite see why it's not working.refreshit moves tables, but not views.no error messages ( if you do this what does the Progess Tab say)Quick checksare all the tables"dbo"?You do have the rights to create views?If you create a new database ( one table, one view) can you export this?do you fancy doing the logging, or looking at the source code(XML)?
Free Windows Admin Tool Kit Click here and download it now
May 6th, 2009 2:48pm

Hi, I've been facing with a similar issue here. The Transfer SQL Server objects task does copy all the tables, but fails to copy the views, SPs and user defined functions. After some analysis I found that if the views refer to other views within the DB then these are not created. Also tried by setting the IncludeDependentObjects to True but the result is the same. One more thing I noticed is that if there is any invalid view (i.e. which cannot be compiled) then the SSIS package would just not copy the view also ignore the other views to follow. There is no error also raised. Looks like the Transfer SQL Server objects task just generated Create Scripts and tries to execute and any dependency object not found it fails to execute and worst it does not even throw up an error. FYI, i'm using SQL 2005. Would be eager to know if there is any work around for this? Arvind.
May 19th, 2011 5:03am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics