Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_SetPublicInterfaceObject

  No additional text.


Syntax

---------------------------- sp_SetPublicInterfaceObject 
CREATE PROCEDURE sys.sp_SetPublicInterfaceObject
	@object	sysname,		-- object name
	@grantpublic bit = 1,	-- select/execute granted to public by default
	@owner sysname = N'sys'	-- object schema name
AS
	SET NOCOUNT ON
	SET ARITHABORT ON
	IF @@TRANCOUNT > 0 OR IS_SRVROLEMEMBER('sysadmin') = 0
		RETURN (1)

	-- Clean up object info first
	DECLARE @schid int, @objid int
	SELECT @schid = CASE @owner WHEN 'sys' THEN 4
		WHEN 'INFORMATION_SCHEMA' THEN 3 END
	SELECT @objid = id FROM sys.sysschobjs
		WHERE name = @object AND nsid = @schid AND nsclass = 0

	DELETE sys.sysobjrdb WHERE id = -@objid
	DELETE sys.syscolrdb WHERE id = -@objid

	-- Populate object/column/parameters
	INSERT INTO sys.sysobjrdb
		SELECT 	-id, nsid, type, created, name
		FROM sys.sysschobjs
		WHERE id = @objid
	INSERT INTO sys.syscolrdb
		SELECT	-id, colid, number, name, utype, xtype, prec, scale, status, length,
			case when collationid = 0 then 0
			when ColumnProperty(id, name, 'IsCollationFixed') = 1 then collationid
			else -1 end
		FROM sys.syscolpars
		WHERE id = @objid

	EXEC %%Object( Owner = @owner, Name = @object ).SetPublicSystemObject( PublicAccess = @grantpublic )

 
Last revision 2008RTM
News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash