Running sysfiles on a database, bringing in error.

  • HI Experts,

    Whenever I'm runing query against the below database alone, it throws me the error. Any suggest why this happens?

    use [AdventureWorks_2005]

    SELECT * FROM dbo.sysFILES

    OR

    SELECT * FROM [AdventureWorks_2005].[sys].[SYSFILES]

    Error- >

    Msg 208, Level 16, State 1, Line 2

    Invalid object name 'dbo.sysFILES'

    Thanks.

  • SQL-DBA-01 (4/30/2015)


    HI Experts,

    Whenever I'm runing query against the below database alone, it throws me the error. Any suggest why this happens?

    use [AdventureWorks_2005]

    SELECT * FROM dbo.sysFILES

    OR

    SELECT * FROM [AdventureWorks_2005].[sys].[SYSFILES]

    Error- >

    Msg 208, Level 16, State 1, Line 2

    Invalid object name 'dbo.sysFILES'

    Looks like you are running on a server with a case sensitive collation, try this:

    use [AdventureWorks_2005]

    SELECT * FROM sys.sysfiles

    OR

    SELECT * FROM [AdventureWorks_2005].[sys].[sysfiles]

  • SQL-DBA-01 (4/30/2015)


    HI Experts,

    Whenever I'm runing query against the below database alone, it throws me the error. Any suggest why this happens?

    use [AdventureWorks_2005]

    SELECT * FROM dbo.sysFILES

    OR

    SELECT * FROM [AdventureWorks_2005].[sys].[SYSFILES]

    Error- >

    Msg 208, Level 16, State 1, Line 2

    Invalid object name 'dbo.sysFILES'

    Quick note, sys.sysfiles is a backward compatibility view (SQL Server 2000 system tables) and should not be used, suggest you use the sys.master_files view instead.

    😎

    BTW you are getting this error because the sysfiles are in the sys schema, not in the dbo schema.

  • Eirikur Eiriksson (5/3/2015)


    SQL-DBA-01 (4/30/2015)


    HI Experts,

    Whenever I'm runing query against the below database alone, it throws me the error. Any suggest why this happens?

    use [AdventureWorks_2005]

    SELECT * FROM dbo.sysFILES

    OR

    SELECT * FROM [AdventureWorks_2005].[sys].[SYSFILES]

    Error- >

    Msg 208, Level 16, State 1, Line 2

    Invalid object name 'dbo.sysFILES'

    Quick note, sys.sysfiles is a backward compatibility view (SQL Server 2000 system tables) and should not be used, suggest you use the sys.master_files view instead.

    😎

    BTW you are getting this error because the sysfiles are in the sys schema, not in the dbo schema.

    Actually, the following works just fine when run on my SQL Server 2012 DE installation:

    select * from dbo.sysfiles;

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply