locked
Where can I find the SP: sp_MSget_file_existence ? RRS feed

  • Question

  • Am having problem with setting up a Distributor (Replication).  Have traced it to the the stored proc sys.sp_MSget_file_existence failing on finding the default data folder.

    I tried manually to exec sp_MSget_file_existence on the folder:


    DECLARE @file_exists BIT, @data_folder nvarchar(255)


    SELECT @data_folder=N'C:\'

            exec sys.sp_MSget_file_existence @data_folder, @file_exists OUTPUT
            if @file_exists = 0
            begin
                raiserror(14430, 16, -1, @data_folder)
            end


    BUT i get the error:

    Msg 2812, Level 16, State 62, Line 7
    Could not find stored procedure 'sys.sp_MSget_file_existence'.


    Tried to find it ... no success.  The following also yields no results:

    select name as object_name, object_definition(object_id) as sql_definition from sys.system_objects
    WHERE name like 'sp_MSGet_file%'.

    Thanks
    Tuesday, June 9, 2009 11:46 AM

Answers

  • Many of those undocumented features and procedures life in the ressource database which is a hidden database.

    -Jens
    Jens K. Suessmeyer http://blogs.msdn.com/Jenss
    Tuesday, June 9, 2009 6:53 PM

All replies

  • I should exist in the master database.  What version of SQL Server is this on?

    Jonathan Kehayias
    http://sqlblog.com/blogs/jonathan_kehayias/
    http://www.twitter.com/SQLSarg
    http://www.sqlclr.net/
    Please click the Mark as Answer button if a post solves your problem!
    Tuesday, June 9, 2009 2:18 PM
  • Many of those undocumented features and procedures life in the ressource database which is a hidden database.

    -Jens
    Jens K. Suessmeyer http://blogs.msdn.com/Jenss
    Tuesday, June 9, 2009 6:53 PM
  • SQL Server 2005 Enterprise
    Thursday, June 11, 2009 3:08 PM
  • Many of those undocumented features and procedures life in the ressource database which is a hidden database.

    -Jens
    Jens K. Suessmeyer http://blogs.msdn.com/Jenss

    This is a usless answer. I dont understand, your supreme knowledge on this topic leaves me still guessing what to do here.

    How do i execute my stored procedure that is looking for that 'sp_MSget_file_existence'

    EXEC master..sp_MSget_file_existence @MDFpathFromServer, @res out

    Tuesday, March 6, 2012 10:52 PM
  • Many of those undocumented features and procedures life in the ressource database which is a hidden database.

    -Jens
    Jens K. Suessmeyer http://blogs.msdn.com/Jenss

    This is a usless answer. I dont understand, your supreme knowledge on this topic leaves me still guessing what to do here.

    How do i execute my stored procedure that is looking for that 'sp_MSget_file_existence'

    EXEC master..sp_MSget_file_existence @MDFpathFromServer, @res out

    It's not a useless answer, you are trying to use something undocumented and it's not guaranteed to be available to you.  Just because that isn't the answer that you want, doesn't make it an incorrect answer, nor does it change the fact that many of the system objects were moved into the resource database in SQL Server 2005 and you can't access some of those things.  If this is your own code, try xp_fileexists, which is also undocumented, but available all the way through 2012 RTM currently.


    Jonathan Kehayias | Principal Consultant, SQLSkills.com
    SQL Server MVP | Microsoft Certified Master: SQL Server 2008
    Author of Troubleshooting SQL Server: A Guide for Accidental DBAs
    Feel free to contact me through My Blog or Twitter. Become a SQLskills Insider!
    Please click the Mark as Answer button if a post solves your problem!

    • Proposed as answer by Naomi N Wednesday, March 7, 2012 2:29 AM
    Wednesday, March 7, 2012 1:21 AM