Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Jun 2006
    Location
    DC
    Posts
    123

    Unanswered: Scripting Out all Column Names

    Morning guys,
    I have a project where Iam suppose to script all columns in every database/table/columns on the network.
    I figured the best way to do this would be using sql-dmo (Sql Server 2000)

    Does anyone have any suggestions on getting started with this project?

    thanks,
    Jonathan

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    query the INFORMATION_SCHEMA views
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Use Enterprise Mangler, right click on the database, and chose script the daabase?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Jun 2006
    Location
    DC
    Posts
    123
    I appreciate the suggestions. But I should have been more descriptive......
    I want to create a sql-dmo script that when entering the server name, database name... it will go through "automatically" and script out all columns for each non system table in the database... I'm almost there...but need a little bit mroe guidance.....
    thanks,
    Jonathan

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by jdmarsh2g
    I appreciate the suggestions. But I should have been more descriptive......
    I want to create a sql-dmo script that when entering the server name, database name... it will go through "automatically" and script out all columns for each non system table in the database.
    The big question: WHY?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  7. #7
    Join Date
    Jun 2006
    Location
    DC
    Posts
    123

    audit

    management wants all column.... names of all tables from all databases....
    an audit of some sort

  8. #8
    Join Date
    Jun 2006
    Location
    DC
    Posts
    123
    thanks brett...
    thanks guys...

  9. #9
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    An audit?
    Are they afraid some employees may be stealing column names?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  10. #10
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    sounds like database design by management committee. sounds like fun. can you get a webcam in that meeting.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  11. #11
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I bet they want to make sure all the columns conform to their standard naming convention:

    Code:
    tblEmps
    colfnam varchar(max)
    collnam varchar(max)
    colbdate char(10)....
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  12. #12
    Join Date
    Jun 2006
    Location
    DC
    Posts
    123
    looking for all sensitive column(s) names

  13. #13
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sensitive column names???

    person_touchiness smallint not null
    company_is_shy boolean
    order_items_underwear varchar(937)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  14. #14
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Damn, Rudy sniped my joke
    George
    Home | Blog

  15. #15
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Don't let that stop you

    the_spare_key_to_the_company_safe_is_in_the_flower _pot_on_the_window_sill VARBINARY(MAX)
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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