Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSgetdbversion

  No additional text.


Syntax

-- Name:
--		sp_MSgetdbversion

-- Description:
--		Retrieves the guid restore version value and converts it to a nearly unique int.
-- 	
-- Parameters:
--	 	See the procedure definition.

-- Returns:
--		0 - succeeded
--      1 - failed

-- Result:
--		None

-- Security:
--		Called by dist agents  (must be made public).
--		SYSADMIN or DBO of db
--  Requires Certificate signature for catalog access

create procedure sys.sp_MSgetdbversion
(
	@current_version int output
)
as
begin
	declare @retcode int,
			@currentGuid uniqueidentifier

	-- Security Check
    if is_srvrolemember('sysadmin') != 1
    	and is_member ('db_owner') != 1
    begin
        raiserror (21050, 16, -1)
        return 1
    end
	
	select @currentGuid = recovery_fork_guid
		from sys.database_recovery_status
		where database_id = db_id()
	if @@error <> 0
		return 1
	
	select @current_version = substring(convert(binary(16), isnull(@currentGuid, 0x0)),1,6)

	return 0
end

 
Last revision 2008RTM
See also

  sp_configure_peerconflictdetection (Procedure)
sp_help_peerconflictdetection (Procedure)
sp_MSdrop_repltran (Procedure)
sp_MSgetpeerlsns (Procedure)
sp_MSgetpeertopeercommands (Procedure)
sp_MSpeerconflictdetection_statuscollection_sendresponse (Procedure)
sp_MSpeerdbinfo (Procedure)
sp_MSrepl_addpublication (Procedure)
sp_MSrepl_changepublication (Procedure)
sp_MSsetupnosyncsubscriptionwithlsn (Procedure)
       



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