Sample Header Ad - 728x90

how to create a data type and make it available in all Databases?

7 votes
2 answers
1014 views
If I create a stored procedure in the master database, and I want to execute it from any of my databases I just follow this link: Making a Procedure Available in all Databases that give me this code example: enter image description here Just by following the example above, I can call my procedure from any database. what about if I create a table data type in master, how can I use it in any of my databases? use master IF NOT EXISTS (select * from sys.types where name = 'theReplicatedTables') CREATE TYPE theReplicatedTables AS TABLE ( OBJ_ID INT NOT NULL, PRIMARY KEY CLUSTERED (OBJ_ID) ); use APIA_Repl_Sub go declare @the_tables [dbo].[theReplicatedTables] enter image description here
Asked by Marcello Miorelli (17274 rep)
Apr 7, 2019, 11:08 PM
Last activity: Apr 8, 2019, 12:16 AM