Syntax to find the used space and free space of the Data
file in a database(SQL Server). Following queries didn't
give the exact Used space and Free Space Information
sp_spaceused;DBCC showfilestats;exec
MyDbName.dbo.sp_spaceused;SP_HELPFILE
Can any one tell me the query for how to find the exact
used data file space and free space in a Data File?
Answers were Sorted based on User's Feedback
Answer / narasimha
SELECT name ,size/128.0 - CAST(FILEPROPERTY
(name, 'SpaceUsed') AS int)/128.0 AS AvailableSpaceInMB
FROM sys.database_files;
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / allah baksh
exec sp_spaceused [schema.tablename] this will give you
data file and the size available
| Is This Answer Correct ? | 0 Yes | 0 No |
When would you use it?
What is the Control Flow in SSIS
What is a Trace frag?Where can we use this?
What is difference between views and tables?
What is 'write-ahead log' in sql server 2000 ?
Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?
When does the auto update index statistics feature in sql server turn itself on?q) what specific conditions database should meet, before you can bulk copy data into it using bcp?
How to sort query output in descending order in ms sql server?
can we have a nested transaction? : Sql server database administration
How to find the list of fixed hard drive and free space on server?
How do you rename a table in sql server?
WHAT IS THE DIFFERENCE BETWEEN CANDIDATE KEY ,COMPOSITE KEY AND PRIMARY KEY. THAN U.
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)