Please can i have some advice on how to go about shrinking a databsae that i have. firstly i shrink the log file and it goes through but it shrinks the log file to a much much smaller size than i stipulated. Secondly i try shrinking the data file and it seems to go through as it says query executed successfully and there are no errors returned but it does not shrink the data file at all. Please can you help, thanks a million.
The second parameter in DBCC SHRINKFILE is size in MB. While I have seen DBCC SHRINKFILE shrink files to about the size specified due to logical log files, or usage, I have never seen it shrink something much smaller than specified.
The datafile may not be shrinking, because it could be full.
You need to empty the database a bit to shrink it.
Get appropriate disks for your data.
Delete some indexes.
Look for inappropriate datatypes (e.g. numbers between 1 and 10 stored in an INT column - these coule be TINYINT)
Archive off and delete some data.
Up the fillfactor of indexes