Printing the Structure of Table

  • Dear Experts

    Can any one please guide me to take the print out of the structure of the table in SQLSERVER 2000 or there is any to do so in ENTERPRISE MANAGER

    - Manish

  • Create a database diagram with just that table. You can specify exactly what the diagram shows (just column names, names and types, etc)

    You can print the database diagram

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • in the enterprise manager copy the entire structure and paste it in notepad and print

  • Are you after pretty graphics or just the detail? It sounds to me like you are more after the DDL than nice presentation. If that is the case from SQL Enterprise Manager you can right click on the table, choose Generate SQL, and either save it to a file and print the file or Preview it, copy it, and paste it in your favorite text editor/word processor. If you want the primary key and/or alternate index information you will need to switch to the options tab and check the appropriate check boxes. You may want to uncheck the "DROP" SQL generation from the middle tab for your purposes. Its only 2 lines, though.

    If you are after the Design view from Enterprise Manager you can ALT-PRTSCN, paste it into Microsoft Paint (or a better editor), crop out what you don't want, select all, copy, and either print from Paint or paste into any word processor (this will likely give you a better print that Paint would).

     

  • Yes, you can print a table structure with

    fields, field length, column types, indices

    etc. with a stored procedure.

    This neat procedure was written by Charles

    Ortivz and was featured in the SQLServerCentral Forum.

    I use it frequently as well as my other

    co-workers its a real "Cool Tool".

    e-mail me for a copy:

    millard_surrency@vistahealthplan.com

  • Sorry,

    email address is :

    millard.surrency@vistahealthplan.com

  • Why not just use the output from sp_help in Query Analyzer? The output can be to 'grids' (To set the output style of query analyzer, just click on Tools menu -> Options and specify the relevant output option on the Results tab).

    Once you have the grid output from:

    sp_help (replace with the appropriate table name)

    you can right click on the intersection of the grid columns and rows (top-left corner of the grid) and you can save the output to a .CSV file, etc.

    Output from Enterprise Manager is great if you want a script to generate or drop the table (appropriately), but does not give you a nicely formatted output if you just want a report on the table structure.

    Regards,

    Mark

Viewing 7 posts - 1 through 6 (of 6 total)

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