Hi,
Try this
---------------------------------
declare @dbsize numeric ---This is the varibale
create table #tb
(Dbname varchar(100),DBsz numeric,remarks varchar(100))
Insert into #tb exec SP_DATABASES
set @dbsize =(select DBsz from #tb where dbName='YourDbName')
select @dbsize as [Database size]
drop table #tb
---------------------------------
You can pass database name also using a variable.
Hope you got my point.
Gud luck
B. Anant
|