Is there a DMV, DMF, or a procedure that will show me metadata function definitions? The function in interest is OBJECTPROPERTY(object_id, property). I have tried looking and reading a lot of material but have no luck. I tried something like this: SELECT * FROM sys.all_sql_modules WHERE definition LIKE ('create%function%OBJECTPROPERTY%') but no luck either. Is it even possible to see the definitions of SQL Server's internal metadata functions using the system catalog? This has been puzzling me for weeks now! Thanks!
You might get some information from the SQL Server Resource database; unfortunately, I haven't got a machine to play with at the moment, so I can't check this myself... :-/ The gist of it is: * Find the mssqlsystemresource files - these are in the same directory as your SQL Server executable. * Copy them to a separate location * Create a new database by attaching these files - you *will* need to change the database name as you do this. Have a rummage around in there. You might get lucky.
I literally tried everything, and it's not letting me attach the database. I tried attaching it just the regular way. I tried doing it as a backup but I keep getting errors. Moving it to different locations and re-naming the .mdf file doesn't seem to do much. Is it possible that there is some proprietary code that SQL Server recognizes and refuses to attach the database. I wonder if trying to clear the .mdf file metadata will do anything. Any ideas? I'll paste below the error I keep getting. =================================== Attach database failed for Server 'DESKTOP-SSECJML'. (Microsoft.SqlServer.Smo) ------------------------------ For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=13.0.16106.4+((SSMS_Rel_16_5).170125-2137)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476 ------------------------------ Program Location: at Microsoft.SqlServer.Management.Smo.Server.AttachDatabase(String name, StringCollection files) at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.Attach() at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SendDataToServer() ===================================![alt text] : /storage/temp/4022-1.jpg
This is only a local server on my laptop I screw around in so i restarted my laptop and was able to successfully attach the file but not before having to change permissions. Thanks for all your help I didn't even know about the resource database file prior.
Just kidding I am back. Do you know if metadata functions such as OBJECT_ID(), SCHEMA_NAME(), or OBJECTPROPERTY() are treated like objects in the resource database? I am looking at definition data and doing string searches across the database but have no luck with finding how these metadata functions are defined.