﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 Administration  / Could not locate file in sys.database_files / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 03:57:36 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Could not locate file in sys.database_files</title><link>http://www.sqlservercentral.com/Forums/Topic1370267-1550-1.aspx</link><description>Use the following command:SELECT file_id,name ,size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS AvailableSpaceInMBFROM sys.database_files;after this command u will find the file id which has free space then run DBCC shrinkfile(file id)</description><pubDate>Wed, 10 Oct 2012 03:18:56 GMT</pubDate><dc:creator>mahesh.dasoni</dc:creator></item><item><title>RE: Could not locate file in sys.database_files</title><link>http://www.sqlservercentral.com/Forums/Topic1370267-1550-1.aspx</link><description>My guess is, you would be using wrong file name</description><pubDate>Wed, 10 Oct 2012 02:26:30 GMT</pubDate><dc:creator>Bhuvnesh</dc:creator></item><item><title>Could not locate file in sys.database_files</title><link>http://www.sqlservercentral.com/Forums/Topic1370267-1550-1.aspx</link><description>Hi AllI had a weird situation this morningOn one of my test systems, I tried running the following command to shrink my log file [code="sql"]DBCC shrinkfile(filename,1024)[/code]I received this error[i]Could not locate file 'filename' for database 'database_name' in sys.database_files. The file either does not exist, or was dropped. [/i]I checked and the file does exist.I ran a full Consistency Check (DBCC CHECKDB) and that seems to have fixed the problem.Has anyone else come across this before? Should I be worried?Thanks</description><pubDate>Tue, 09 Oct 2012 03:46:45 GMT</pubDate><dc:creator>SQLSACT</dc:creator></item></channel></rss>