Hi,
I want to find the size of the MDF file for a select database.
How can I do this?
Thanks in advance.
Nadee.Try this:
SELECT size*8192 as FileSize
FROM master..sysaltfiles
WHERE fileid=1 AND dbid=DB_ID('YourDatabase')
Razvan|||Gon
Also ,take a look at sp_helpdb 'database' system stored procedure
If you have more than one file
SELECT RTRIM(filename) ,SIZE
FROM sysfiles
WHERE fileid = (SELECT MIN(fileid) FROM sysfiles)
UNION ALL
SELECT RTRIM(filename) ,SIZE
FROM sysfiles
WHERE fileid > (SELECT MIN(fileid) FROM sysfiles) AND
fileid < (SELECT MAX(fileid) FROM sysfiles)
UNION ALL
SELECT RTRIM(filename),SIZE
FROM sysfiles
WHERE fileid = (SELECT MAX(fileid) FROM sysfiles)
"Gon Nadiya" <WazHot@.mymail.com> wrote in message
news:u$f5%23mllFHA.420@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I want to find the size of the MDF file for a select database.
> How can I do this?
> Thanks in advance.
> Nadee.
>|||Used the extended stored procedure xp_getfiledetails to give you size of fil
e
but the name of the file will be on NT format example 'BL4BB2~1.BKP'
EXEC master.dbo.xp_getfiledetails
'\\Blptcsqlmon01\backup\BLDALSTGSQL04\TR
AN_Backup\blcms_TRAN_BU_20050801_00.
bkp'
"Gon Nadiya" wrote:
> Hi,
> I want to find the size of the MDF file for a select database.
> How can I do this?
> Thanks in advance.
> Nadee.
>
>|||Hi URI,
Thanks for the support.
It worked with no issues.
Nadee.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OL0qrQmlFHA.1048@.tk2msftngp13.phx.gbl...
> Gon
> Also ,take a look at sp_helpdb 'database' system stored procedure
> If you have more than one file
>
> SELECT RTRIM(filename) ,SIZE
> FROM sysfiles
> WHERE fileid = (SELECT MIN(fileid) FROM sysfiles)
> UNION ALL
> SELECT RTRIM(filename) ,SIZE
> FROM sysfiles
> WHERE fileid > (SELECT MIN(fileid) FROM sysfiles) AND
> fileid < (SELECT MAX(fileid) FROM sysfiles)
> UNION ALL
> SELECT RTRIM(filename),SIZE
> FROM sysfiles
> WHERE fileid = (SELECT MAX(fileid) FROM sysfiles)
> "Gon Nadiya" <WazHot@.mymail.com> wrote in message
> news:u$f5%23mllFHA.420@.TK2MSFTNGP09.phx.gbl...
>|||Does anyone know how to get file size in Dos - need way to verify file size
is not equal to 0 bytes.
JC
"JosephPruiett" wrote:
> Used the extended stored procedure xp_getfiledetails to give you size of f
ile
> but the name of the file will be on NT format example 'BL4BB2~1.BKP'
> EXEC master.dbo.xp_getfiledetails
> '\\Blptcsqlmon01\backup\BLDALSTGSQL04\TR
AN_Backup\blcms_TRAN_BU_20050801_0
0.bkp'
>
>
> "Gon Nadiya" wrote:
>|||Not sure I understand you, bit how about DIR?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"JC" <JC@.discussions.microsoft.com> wrote in message
news:44944802-D81D-481A-A475-0D82E0EC04BA@.microsoft.com...
> Does anyone know how to get file size in Dos - need way to verify file si
ze
> is not equal to 0 bytes.
> JC
> "JosephPruiett" wrote:
>|||sp_helpfile
"JC" <JC@.discussions.microsoft.com> wrote in message
news:44944802-D81D-481A-A475-0D82E0EC04BA@.microsoft.com...
> Does anyone know how to get file size in Dos - need way to verify file
> size
> is not equal to 0 bytes.
> JC
> "JosephPruiett" wrote:
>sql
Showing posts with label mdf. Show all posts
Showing posts with label mdf. Show all posts
Wednesday, March 21, 2012
Subscribe to:
Posts (Atom)