DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   How to print tables in SQL Server 2005 (http://www.daniweb.com/forums/thread75529.html)

quiptro Apr 16th, 2007 6:54 pm
How to print tables in SQL Server 2005
 
Hi,

I have a small database with 15 tables and 20-40 records in each table. I just want to ask how can I print all the tables together with their names, atribute names and all the records? (the Print option from the File menu is not active)

Thanks,
Robert

jbennet Apr 16th, 2007 7:05 pm
Re: How to print tables in SQL Server 2005
 
It depends

You can either:

Use The MSSQL Managament Studio ( i think)

Write a program / web app to do it

Use Crystal Reports?

hollystyles Apr 16th, 2007 7:07 pm
Re: How to print tables in SQL Server 2005
 
In Sql Server Management studio expand databases on the left, expand the database that contains your tables, right click on Database diagrams and choose 'New database diagram', you may at this point receive a message saying you don't have all the support objects required, click ok to have them created. A dialogue box appears with a list of the tables, select them all and click add. Now choose Print from the file menu. You may need to manually size and drag the tables around if you want to fit them to one A4 page.

quiptro Apr 16th, 2007 10:02 pm
Re: How to print tables in SQL Server 2005
 
Thanks for the prompt response. I followed your instructions and created the diagram and the Print option became active. However, it only printed the diagram and all the relationships mapped, and did not print the tables with their content (the records). I just need to simply print the tables (just like if they were in exel). Thanks.

jbennet Apr 17th, 2007 3:20 am
Re: How to print tables in SQL Server 2005
 
I think you wil need to produce a report then, either by writing an web or local application or by using a report generator (crystal reports maybe?)

hollystyles Apr 17th, 2007 4:44 am
Re: How to print tables in SQL Server 2005
 
In Sql Server Management Studio, expand databases, right click your database and choose tasks -> Export. In the first wizard page choose the source (this should already be the databse you just right clicked), click next. In the destination drop down choose Microsoft Excel, browse to a folder and type a filename, check the box 'First row has column names' click next. Choose the first option 'Copy data from one or more tables or views' click next. Select all the tables and click next, check the box 'Execute immediately' click next, click finish.

M_K_Higa Apr 17th, 2007 9:09 pm
Re: How to print tables in SQL Server 2005
 
You can create a view to get the data you want and the import it into excel. The "Import External Data" is in the Data menu, and is wizard based, so it's pretty easy.

If your data changes, all you have to do is refresh your excel sheet and you get updated data as well.

quiptro Apr 17th, 2007 10:12 pm
Re: How to print tables in SQL Server 2005
 
Thanks to everybody for the responses. I am not much of a programmer so I can not create an application to produce the reports or make one with existing software, but importing and printing the tables in excel using "Import External Data" was straightforward and quite easy. Thanks.


All times are GMT -4. The time now is 10:57 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC