Wednesday, March 28, 2012

How to scale down database diagram to fit into a page for SQL 2005?

In sql 2000 enterprise manager, diagram, I can right click and get page setup where I can shrink the size of the diagram to fit page. In the SQL 2005 diagram, How can I adjust the size of the image printed on paper?

Did Microsoft take this useful feature away?

Steve,

Did you ever figure out how to do this? I am having the same problem now. There has got to be a way to re-size this drawing.

Thanks,

Andy

|||

I figured it out and wrote this doc for my development team.

How To Use Diagram In SQL 2005

Stephan Loh

The Database Designer is a visual tool that allows you to design and visualize a database to which you are connected. When designing a database, you can use Database Designer to create, edit, or delete tables, columns, keys, indexes, relationships, and constraints. To visualize a database, you can create one or more diagrams illustrating some or all of the tables, columns, keys, and relationships in it.(Microsoft Book online)

SQL 2005 allows you to create database diagram (ER diagram, or schema diagram).You can also design database by using this diagram.

1. In Microsoft SQL server Management Studio, Object Explorer, double click on the database you want to work with, right click on Database Diagrams.

2. Select New Database Diagram, add tables.

3. To get print view, right click on the page (Not on a table), select View Page Breaks. This allows you to see the diagram by page.

4. To adjust the size of table,in Microsoft SQL server Management Studio, Click on File at top left corner, select Page Setup.In Page Setup, adjust Print Scale to shrink the size of tables.You can also adjust Orientation, and Select paper size.

5. To make the table show all columns, select one or more tables, right click on one of the tables, and select Autosize Selected Tables.

6. To zoom, (4 ways to zoom), I find the best way is to hold down Ctrl Key, turn the wheel on your mouse.

7. To see more than column name in diagram, highlight tables you want to display other information, right click on one of the selected tables, select Table View,You can select Standard or Other options,if you want to see other information, you will need to select Modify Custom, and add information you want to see.After you click OK, you will need to right click on one of the selected tables, select Table View,Custom.

8. To modify column definition, you can directly click on the cell of column definition to modify it.For example, to modify column name, you click on the column name, and type in new name.

9. To modify a table Name (table property), highlight the table, press F4.

10. To modify a single column,highlight the column, press F4.

11. To add a table, right click on the page (not on a table), and select New Table to start design a new table

12. Add a relationship (Foreign Key Constraint), right click on the foreign key table, and select Relationships.Click on the button on the right side of Tables and Columns Specificationto designate primary key table.

13. To print,in order to make sure WYSIWYG, right click on the page (not on a table), select Recalculate Page Breaks.Review your table layout on computer before you print.

|||Thanks! That is excellent.

-Andy

No comments:

Post a Comment