April 16, 2012

sp_cdc_restoredb (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_cdc_restoredb(nvarchar @srv_orig
, nvarchar @db_orig
, int @keep_cdc)

MetaData:

 create procedure [sys].[sp_cdc_restoredb]  
(
@srv_orig sysname,
@db_orig sysname,
@keep_cdc int
)
as
begin
set nocount on

declare @retcode int

--
-- Security Check: RESTORE statement requires sysadmin, dbcreator, or
-- dbo (THE dbo, not just any member of the db_owner
-- role.)
--
if (ISNULL(IS_SRVROLEMEMBER('sysadmin'),0) = 0)
and (ISNULL(IS_SRVROLEMEMBER('dbcreator'),0) = 0)
and (ISNULL(IS_MEMBER('db_owner'),0) = 0)
begin
raiserror(18799, 16, -1)
return 1
end

exec @retcode = sys.sp_cdc_restoredb_internal @srv_orig
, @db_orig
, @keep_cdc

if @retcode <> 0 or @@error <> 0
begin
return 1
end

return 0
end

No comments:

Post a Comment

Total Pageviews