Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004
    Posts
    12

    Unanswered: Script Objects on SQL Server

    Hi..

    I need a script to export all the objects from my DB, I can't use DTS because this server is on another private LAN , so the only thing that i can do is drop a *.sql file on a common sharing server and my other server will execute it from that location.

    What do you recommend? I know i can do it from My Enterprise Manager but i need to run it on a schedule time .....

    Anybody has a script for it ? Any clue?

    Thanks a lot.

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    If you don't plan to change your schema, then you can script your DB using EM and save the script as a file.

    If changes are anticipated, you can look into using SQL-DMO and write your own script. You can also google "Script database" and am sure you'll find a couple of hits there.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Jul 2004
    Posts
    12
    The schema is changing always ...

    It's for the QA guys but they work on a private LAN ... They can't reach our Production LAN..

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Look up this file in your directory structure (scptxfr.exe). My personal edition has it in C:\Program Files\Microsoft SQL Server\MSSQL\Upgrade directory.

    Also, check http://database.ittoolbox.com/code/d.asp?d=1691&a=s
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  5. #5
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    In case you still wonder, this is a sample command line that would generate all objects of PUBS database:

    "C:\Program Files\Microsoft SQL Server\MSSQL\Upgrade\scptxfr.exe" /s <SERVER_NAME> /I /d pubs /r /f C:\test.sql
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •