How to script objects separately ?

  • Hi,

    I need to create DDL scripts for all database tables one object per file. Is it possible in SSMS ? I could only find how to create them all in one file.

    Thanks

     

     

  • Output screen

    yes its possible, you need to specify on your output screen


    Everything you can imagine is real.

  • how do i load an image i have tried using insert image, but its not doing anything. i wanted to upload the screen shot


    Everything you can imagine is real.

  • You need to upload it onto a web server.  AFAIK, there's no working way to do this at the moment.

  • Bledu, on output screen of Script Wizard ?

    It has 5 screens:

    1- select database

    2- choose script options

    3- choose object type - I choose tables

    4- select tables - I select at least two

    5- output option

    At 5th screen it does not have any options to script to separate files, all of them go to File Name. Also, in 2nd screen it has Append to File, no matter True of Flase it scripts all to one file. any other options ?

  • are you using sql server express, if that is the case then that is why you are not getting the options


    Everything you can imagine is real.

  • SQL Server express ? Here is the output of my select @@version:

    Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86)

     Apr 14 2006 01:12:25

     Copyright (c) 1988-2005 Microsoft Corporation

     Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

    And here is the info from SSMS Help/about:

    Microsoft SQL Server Management Studio   9.00.1399.00

    Microsoft Analysis Services Client Tools  2005.090.1399.00

    Microsoft Data Access Components (MDAC)   2000.085.1117.00 (xpsp_sp2_rtm.040803-2158)

    Microsoft MSXML      2.6 3.0 4.0 5.0 6.0

    Microsoft Internet Explorer    6.0.2900.2180

    Microsoft .NET Framework    2.0.50727.832

    Operating System     5.1.2600

    It does not have wording "express" anywhere. Or I am missing something ?

     

  • Mark,

    I did not mean to offend you by my question.

    Anyway I tested your question on a standard edition and managed to get the option to save to different file, but did not get the same options on sql express


    Everything you can imagine is real.

  • No problem, you did not offend me.

    So it looks like I have to "upgrade" from Enterprice to Standard edition ?

    And on what screen this option should be, on the last , the 5th one ?

  • on the last screen, i will check for you when i get into the office


    Everything you can imagine is real.

  • Rather than fight with your version of SSMS why not just go download one of the free tools available on the web to do just what you need?  Search for "sql object scripter" on Google/Yahoo and pick one... there are a lot of free ones...

    Joe

  • Mark - a couple of thoughts.

    1. If you have Enterprise Edition, then that's the 'cadillac' full featured version of SS 2k5. But if it's truly full featured, then you should be seeing more options than you are on the Script Wizard.

    2. Are you looking to export these scripts on a regular basis? how many are there?

    3. Are you rejecting the 'brute force' method if SSMS won't do what you want? If you are reluctant to use (free) 3rd party tools, you can always create the one file out of SSMS and then use a text editor window (or two, or three, or how many you like) and separate the procedures out manually. It's ugly, but you can at least make it work. Alternatively, you could manually script them, one at a time, out of the Manager and ensure that they are named and located what you want to call them.

    4. How frequently will these change? The intent behind creating all in one file is to facilitate either backup/restore requirements or the manual replication of the database onto a development / test instance. You are trying to apply a tool to a purpose other than the one it was designed for. Certainly it would be worthwhile to notify MS that there's a need for such a tool. From what I've seen, all DBMS seem to have difficulty with version control on the programming side (stored procedures, triggers, etc) - data management is not programming management.

    5. Consider it job security, in a way. If everything was seamlessly integrated together by the push of a button, many of us would be out of work.

    Sometimes ugly is better than pretty - because you will notice ugly when everything else is beautiful, in the same way you will notice beautiful when everything else is just pretty. The non-conforming pieces always stand out.

Viewing 12 posts - 1 through 11 (of 11 total)

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