April 16, 2012

sp_browsemergesnapshotfolder (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_browsemergesnapshotfolder(nvarchar @publication)

MetaData:

 create procedure sys.sp_browsemergesnapshotfolder (  
@publication sysname
)
AS
BEGIN
SET NOCOUNT ON
DECLARE @dbname sysname
DECLARE @alt_directory_type INT
DECLARE @directory_type INT
declare @retcode int

SELECT @alt_directory_type = 25
SELECT @directory_type = 7

EXEC @retcode = dbo.sp_MSreplcheck_publish
IF @@ERROR <> 0 or @retcode <> 0
return (1)

IF object_id(N'sysmergepublications') is not NULL AND
object_id(N'sysmergeschemachange') is not NULL
BEGIN
SELECT 'snapshot_folder' = schematext
FROM dbo.sysmergeschemachange sc
INNER JOIN dbo.sysmergepublications mp
ON sc.pubid = mp.pubid
WHERE mp.name = @publication
AND upper(mp.publisher) = upper(publishingservername())
AND publisher_db = db_name()
AND (schematype = @directory_type OR schematype = @alt_directory_type)
ORDER BY schematype desc
END
ELSE
BEGIN
SELECT @dbname = DB_NAME()
RAISERROR(21147, 16, -1, @dbname)
RETURN 1
END
END

No comments:

Post a Comment

Total Pageviews