scripting data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • farseer

    scripting data

    Hi,

    I need to take data from a SQL Serer 2005 database, and load into a
    remote 2000 database. I've already been able to script and create the
    database objects (MS SQL Server 2005 has a nifty option which allows
    you to scripting for SQL Server 2000 compliance). Now i just need to
    get the data in.

    Is there a tool or utility out there that i can use to generate insert
    statements for all the tables in database?

    Thanks much for any advice regarding this.

  • Mork69

    #2
    Re: scripting data

    On Feb 13, 6:07 am, "farseer" <fars...@optonl ine.netwrote:
    Hi,
    >
    I need to take data from a SQL Serer 2005 database, and load into a
    remote 2000 database. I've already been able to script and create the
    database objects (MS SQL Server 2005 has a nifty option which allows
    you to scripting for SQL Server 2000 compliance). Now i just need to
    get the data in.
    >
    Is there a tool or utility out there that i can use to generate insert
    statements for all the tables in database?
    >
    Thanks much for any advice regarding this.
    Hi,

    Yes, there is and it's called DB Ghost (www.dbghost.com). It has a
    Data and Schema Scripter (which does what you need) and a host of
    other tools that form a complete change management process for SQL
    Server.and can all be called from the command line for full process
    automation :)

    Kind regards,

    Malcolm

    Comment

    • Erland Sommarskog

      #3
      Re: scripting data

      farseer (farseer@optonl ine.net) writes:
      Is there a tool or utility out there that i can use to generate insert
      statements for all the tables in database?
      SELECT 'bcp yourdb..' + name + ' out ' + name + '.bcp -n -T'
      FROM sys.objects
      WHERE type = 'U'

      Copy result into a BAT file and run.

      The to load:

      SELECT 'bcp yourtargetdb..' + name + ' in ' + name + '.bcp -n -T ' +
      '-S REMOTSER' +
      CASE WHEN EXISTS (SELECT *
      FROM sys.columns c
      WHERE o.object_id = c.object_id
      AND c.is_identity = 1)
      THEN ' -E '
      ELSE ''
      END
      FROM sys.objects o
      WHERE type = 'U'

      I assume that you are not using any data types that are not available
      in SQL 2005.


      --
      Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

      Books Online for SQL Server 2005 at

      Books Online for SQL Server 2000 at

      Comment

      Working...