moving the database from one server to another server without data in the table

  • I have a doubt about moving the database from one server to another server without data in the table.

    I have a database in developement server. I want to move the database to my production server

    I have using backup/restore and copy database method but these methods will move the data also.

    i want only database with table structure (without data)

    Is there any way to do it?

    urgent reply needed.

    Thanks in advance,

    Anthuvan

  • anthu_soft (10/22/2009)


    I have a doubt about moving the database from one server to another server without data in the table.

    I have a database in developement server. I want to move the database to my production server

    I have using backup/restore and copy database method but these methods will move the data also.

    i want only database with table structure (without data)

    Is there any way to do it?

    urgent reply needed.

    Thanks in advance,

    Anthuvan

    Well one option is to just script the database and run the script on your production server, this will just create the database with just the options that you specify

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

  • Another option is to restore the database, then truncate all the tables. This can be difficult if you have a lot of referential integrity between tables because they need to be truncated in the correct sequence. It has the benefit of bringing over all the objects, logins, object permissions etc...

    query results to text:

    set nocount on

    use Database_Name

    select 'use Database_Name'

    SELECT 'truncate TABLE ' + o.name

    FROM (select name from sys.objects where type = 'U' ) o

    order by o.name

  • This script will truncate tables that are not referenced and delete the data from tables with foreign key references and then reseed the identity columns.

    Truncate All Tables

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=65341

  • Download and install SQL Compare from Redgate (fully functional trial version). Then, create a new blank database in production and perform a comparison between the database in development and the brand new blank database in production.

    You will then be given the option to synchronize the databases - which will apply the scripts that SQL Compare generates. Or, you could save the scripts and apply them later - or both...

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 5 posts - 1 through 4 (of 4 total)

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