• Attempting to change a variety of SET options has no effect. SQL 2008 acts like SQL 2012.

    The RESTORE VERIFYONLY on a file that exists returns two errors; SQL 2005 SP4 catches one and lets the other through. SQL 2008 SP3 and 2012 RTM catch one and hide the other.

    Does anyone know a good way to get a single error if a file is locked (without using xp_cmdshell or other syadmin level commands)? As a note, both xp_fileexist, like xp_dirtree, are returning the filename without any errors, even in SQL 2005.