Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Estimate size of view?

Author  Topic 

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2011-01-14 : 16:38:29
i have a view which pulls 100 million records from a table. now i am extracting this view to a csv. Is there a way to estimate the size of the csv? If the size is going to be same as view, then how can i calculate the view size?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-01-14 : 16:44:46
A view does not have a "size", it merely returns data. The size of the data depends on how you are saving/exporting it.

You might be able to calculate it ahead of time, but frankly the easiest way is to just export to a file and see how big it is.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-14 : 16:46:21
You are going to extra 100 million rows to a csv file? That file size will be big. We can't tell you the answer as we don't know the DDL of the tables that are inside the view or the view definition.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2011-01-14 : 16:48:14
i will be exporting around 40 files and most of them will be having more than 10 million. So it is hard to run and get the size. Is the size gonna be the same size of view(TABLE)?
Go to Top of Page

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2011-01-14 : 16:53:14
Yes Tara...out of my 40 exports, there is one which has around 100 million records.

So is the size gonna be the same as View(Table)?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-14 : 16:53:48
It will not be the same size of the view/table. Do a small test to see what kind of percentage you'll get going from SQL Server to a text file.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -