Deploying UDFs/SPs across all DBs
You can try out this as given by user Cade Roux in an answer to the Stack Overflow question Common function / stored procedures for all databases:


  Depending upon what the SP actually does, you want to create the procedure in master, name it with sp_ and mark it as a system procedure:


From Running a master db residing stored procedure in current database context by Mladen Prajdić:

USE master
go
CREATE PROC sp_TestMasterAccess
AS
SELECT    * 
FROM    information_schema.tables
GO
-- SS2k5 provides a stored procedure to mark the object as system
EXEC sys.sp_MS_marksystemobject sp_TestMasterAccess
GO
EXEC sp_TestMasterAccess

go
USE AdventureWorks
EXEC sp_TestMasterAccess

go
USE master 
DROP PROC sp_TestMasterAccess