Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Exporting only Defination not data

Exporting only Defination not data

Scheduled Pinned Locked Moved Database
databasesql-serversysadmin
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hum Dum
    wrote on last edited by
    #1

    Is there any way in sql server 2000, 2005 by which we can export only the definition of tables and stored procedure. What i am trying to ask: Suppose there is table creation syntax like:

    Create table TableName
    (col1 datatype,
    col2 datatype,
    .
    .
    .)

    Same as for stored procedure. I want only definition not DATA of whole database. Can it be possible.

    M W S M 4 Replies Last reply
    0
    • H Hum Dum

      Is there any way in sql server 2000, 2005 by which we can export only the definition of tables and stored procedure. What i am trying to ask: Suppose there is table creation syntax like:

      Create table TableName
      (col1 datatype,
      col2 datatype,
      .
      .
      .)

      Same as for stored procedure. I want only definition not DATA of whole database. Can it be possible.

      M Offline
      M Offline
      Mike Osbahr
      wrote on last edited by
      #2

      If you have the management studio available just right click on the object you want to script. In 2000 you select All Tasks -> Generate SQL script. In 2005 it is slightly different but just as easy to accomplish.

      Thanx, >>>-----> MikeO

      1 Reply Last reply
      0
      • H Hum Dum

        Is there any way in sql server 2000, 2005 by which we can export only the definition of tables and stored procedure. What i am trying to ask: Suppose there is table creation syntax like:

        Create table TableName
        (col1 datatype,
        col2 datatype,
        .
        .
        .)

        Same as for stored procedure. I want only definition not DATA of whole database. Can it be possible.

        W Offline
        W Offline
        Wayne Gaylard
        wrote on last edited by
        #3

        You can use SHOW CREATE TABLE which will give you the correct CREATE TABLE statement for each table. Happy Coding.

        1 Reply Last reply
        0
        • H Hum Dum

          Is there any way in sql server 2000, 2005 by which we can export only the definition of tables and stored procedure. What i am trying to ask: Suppose there is table creation syntax like:

          Create table TableName
          (col1 datatype,
          col2 datatype,
          .
          .
          .)

          Same as for stored procedure. I want only definition not DATA of whole database. Can it be possible.

          S Offline
          S Offline
          SomeGuyThatIsMe
          wrote on last edited by
          #4

          Right click on the database -> All Tasks (Or New i cant remember for 2000 anymore)-> Generate SQL Script then run through the wizard, by defualt 2000 wont script out the data, at least mine wouldnt. I do remember that in 2000 you had to check the "Show All Items" box, then you could use the newly enabled check boxes below it to select all items of a certain type. If yours is giving you all the data there should be an option to disable it in one of the tabs of the wizard, my problem with 2k was getting the data in the table out w/out doing an ExportData. I've never used 2005, but if its similar to 2008 there is an option in, i believe the second step of the Generate Script wizard, that says Script out Data. Its in the bottom section of the large properties panel looking step. before you pick the objects you want. Hope it helps.

          Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

          1 Reply Last reply
          0
          • H Hum Dum

            Is there any way in sql server 2000, 2005 by which we can export only the definition of tables and stored procedure. What i am trying to ask: Suppose there is table creation syntax like:

            Create table TableName
            (col1 datatype,
            col2 datatype,
            .
            .
            .)

            Same as for stored procedure. I want only definition not DATA of whole database. Can it be possible.

            M Offline
            M Offline
            Md Marufuzzaman
            wrote on last edited by
            #5

            You can try the following transact-sql which will return all the table with the column definition of a particular database.

            SELECT * FROM targetDatabase.INFORMATION_SCHEMA.COLUMNS

            Thanks Md. Marufuzzaman


            I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups