I was looking at the source of sys.sp_dbcmptlevel in SQL Server 2005.
In the source, there is this line I do not understand how it works.
EXEC %%DatabaseEx(Name = @dbname).SetCompatibility(Level = @input_cmptlevel)
It doesn't appear that DatabaseEx
is a stored procedure.
-- does not return any result
select *
from sys.procedures
where [name] like '%DatabaseEx%'
So my questions are
- What is
DatabaseEx
and what does it do? - What is %% before
DatabaseEx
?