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)
 Correct syntex for sp_spaceused

Author  Topic 

kirknew2SQL
Posting Yak Master

194 Posts

Posted - 2008-02-10 : 17:11:56
Trying to execute this SP i get the table is not part of the DB. What is the correct syntex?

EXECUTE sp_spaceused 'templog.ldf'

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-02-10 : 17:33:31
Run sp_spaceused alone will give you db data file space usage with 'sp_spaceused tab_name' will give you table sppace usage. Use 'dbcc sqlperf(logspace)' to check log file usage.
Go to Top of Page

kirknew2SQL
Posting Yak Master

194 Posts

Posted - 2008-02-10 : 18:02:30
Is ther a SP that will return the iniotial size and current size of tempDB? So when i shrink it i will know what to expect.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-02-10 : 20:32:24
Not as I aware of. Don't shrink tempdb, it'll go back to initial size when restart sql.
Go to Top of Page

kirknew2SQL
Posting Yak Master

194 Posts

Posted - 2008-02-10 : 20:44:11
TEMPDB never whent back to initial size. It is over 15G now and growing. SQL is closed ever night but the server is not. Don't I need RECOVERY set to SIMPLE or something like that for temp DB to reset?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-02-10 : 20:49:17
Sql sets tempdb to simple recovery model when starts up. If its size is always, say, 15gb, that means its initial size is about 15gb. You may change initial size before restarting sql.
Go to Top of Page

kirknew2SQL
Posting Yak Master

194 Posts

Posted - 2008-02-10 : 20:57:28
Thanks for your help. I am getting the expected results.
Go to Top of Page
   

- Advertisement -