December 1, 2009 at 4:07 am
I’ve got a remote database that I need to download and restore to another server.
The BAK file’s pretty big.(I’ve already shrunk the database and the files.The log file isn’t very big.
I don’t remember that much data being on it.
Data: 136192 KB
Log: 1024 KB
Is there any other way to reduce the size of the database, short of going in and deleting data?
If not, I need to know which tables contain the most data…Can I find out the above via a query?
Many thanks,
yogi
December 1, 2009 at 5:48 am
Yogi,
Check this out.
http://sql-articles.com/scripts/table-space-details
Regards..Vidhya Sagar
SQL-Articles
December 1, 2009 at 6:07 am
run this
declare @STR varchar(max)
create table #tmpspace (name varchar(100), rows int, reserved varchar(200), data varchar(200), index_size varchar(200), unused varchar(200))
select @STR = isnull(@str,'') + ' insert #tmpspace exec sp_spaceused [' + name + ']' from sys.tables
exec (@str)
update #tmpspace
set data = replace(data,'kb','')
select name [Table], rows [Rows], cast(data as int) [size(KB)] from #tmpspace
order by cast(data as int) desc
December 1, 2009 at 9:07 am
hiya,
Worked like treat.
Thanks folks,
yogi
December 1, 2009 at 12:46 pm
That's only 136 Mega bytes... why the concern?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 2, 2009 at 4:38 am
hiya,
I had to upload it from 1 server to another.
When it was too big the web upload would timeout.
cheers,
yogi
December 2, 2009 at 8:15 pm
Ah... got it. Didn't really register on me what you were doing. Thanks for the feedback.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply