SQL2005 Database Backup Script

  • Hi Everybody,

    I am getting errors When taking the sql2005 database .For ex views are scripted before table creation.I don't know may be i am wrong or its bug?. So i am taking NOT EXISTS script and then tables script after that functions,views and procedures . It consumes lot of time. Is there any other way to take the script? or any tool or link avaiable for database change script from development database to production database?

    Thanks in advance.:)

    Ramaa

  • The problems with the order may be because of messed up sysdepends or sys.sql_dependencies table. 2008 will help, but until then third party tools are the easy way. Red Gate's SQL Compare can determine the reorder (indeed you can use it to fix the sys.sql_dependencies if you sync to an empty database). It is a comparison tool that can compare your database (or scripts). There are other products too, e.g. from Apex, Quest, Microsoft (Visual Studio Team Systems for Database Professionals).

    Disclaimer: I work for Red Gate.

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Hai Andras,

    Thank You very much for your info.

    Ramaa

  • Its true that there is a problem while creating script in SQL 2005.

    You can alos use Apex SQL studio which is a 3rd aprty tool.

  • Hi guys! I'm new here in this forums, five months ago I was suscribed in this page, I don't speak very well English but texts and technical articles I understand more or less because I'm working with SQL Server since 7.0 version, and I'm going to take a certification exam (Implementation and Maintenance), I hope learn and make contribution, I'm from Paraguay a country from SouthAmerica.

    I used script to backup a database and after programming through a windows service to run periodically, specially in the express edition because that version as you know doesn't have this issue, but in another case we have the Database Maintenance Plan.

  • If you cannot get your hands on a 3rd party tool, I would just script each set of objects. This way you will have a file for Tables, Schemas, Views, Stored Procs, Function etc.

    I would then create a .bat file that makes sqlcmd or osql calls to run the scripts over a instance. The bat file can manage the order in which they are run automatically or you can simply run them manually in the desired order.

  • If (non-schemabound) views are the only problem, the following might help:

    SELECT 'EXEC sp_refreshview ''' + schema_name(schema_id) + '.'+ name + '''' FROM sys.views

    (you need to execute this statement and then execute the resulting statements to refresh the metadata of your views)

    Best Regards,

    Chris Büttner

  • Hi,

    Thanks to All for your reply. I downloaded MS Visual Studio 2005 Team suit for DB Professional. I am working on that.

    Lot of thanks:)

    Ramaa

  • Hm, Visual Studio Team suit.

    Must be from Versace 😀

    Best Regards,

    Chris Büttner

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply