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 2000 Forums
 SQL Server Development (2000)
 query

Author  Topic 

supersql
Yak Posting Veteran

99 Posts

Posted - 2007-08-17 : 15:13:25
EXEC sp_msforeachtable 'INSERT #spaceused EXEC sp_spaceused ''?'''

How can i use my where clause in this query
like

where datepart(yyyy,convert(char(10),cast(date - 36161 as datetime),101))=1995

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-17 : 15:17:52
Already asked and answered here http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=391318#bm391436
Are you the same poster, or do you attent same class?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

supersql
Yak Posting Veteran

99 Posts

Posted - 2007-08-17 : 15:32:03
yeah but here i am using 2 system store procs, so confused
Go to Top of Page

supersql
Yak Posting Veteran

99 Posts

Posted - 2007-08-19 : 15:22:32
CREATE TABLE #space (

name varchar(18),rows char(11),reserved varchar(18),data varchar(18),index_size varchar(18),unused varchar(18)

)

EXEC sp_msforeachtable 'INSERT #space EXEC sp_spaceused ''?'' where datepart(yyyy,convert(char(10),cast(date - 36161 as datetime),101))=1995'
Go to Top of Page
   

- Advertisement -