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 |
How to create nested stored procedure?
How to turn off warning messages during php execution?
Explain trigger and its types?
What are page splits?
How to get the query of a table in sql server?
What are the different types of sub-queries?
When we are using this query to shrink the log file,what exactly it will execute internally? Do we lose any data when we run this script? which data it will truncate in the log file and where it is saved. Please let me know... USE DatabaseName GO DBCC SHRINKFILE(<TransactionLogName>, 1) BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY DBCC SHRINKFILE(<TransactionLogName>, 1) GO
What are the different types of backups that exist?
How to find table changes in sql server?
How you would rewrite the sql query to return the customerid sorted numerically?
plz tell me the new features of sqlserver2000,sqlserver2002,sqlserver2005
Difference between LEN() and DATALENGTH() in sql server ?