Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSreplicationcompatlevel

  No additional text.


Syntax
create procedure sys.sp_MSreplicationcompatlevel
@dbname             sysname,
@cmptlevel            float(8)
As
    declare        @is_distdb    smallint

    select @is_distdb = 0

    IF EXISTS (select * from msdb.sys.objects where name='MSdistributiondbs')
        begin
            IF EXISTS (SELECT * FROM msdb..MSdistributiondbs where name=@dbname)
                select @is_distdb = 1
        end

    /*
    ** Parameter check
    ** @dbname
    */
    IF NOT EXISTS (SELECT * FROM master.dbo.sysdatabases WHERE
        name = @dbname collate database_default)
    BEGIN
        RAISERROR(15010, 16, -1, @dbname)
        RETURN(2)
    END

    select @dbname = QUOTENAME(@dbname)

    /*
    ** Parameter check. NOTE
    ** @cmptlevel
    */
    IF @cmptlevel<6.0
    BEGIN
        RAISERROR(20060,16,-1)
        RETURN(2)
    END

    /*
    ** If cmptlevel is lower than 7.0, special attention should be paid.
    ** If current database is a distribution database or is involed in merge
    ** replication, then it can not be set to a level lower than 7.0.
    */

    create table #tmp (any_merge smallint NOT NULL)
    insert into #tmp exec ('select count(*) from ' + @dbname + '.sys.objects where name=' + '''sysmergesubscriptions''' )
    if (exists(select any_merge from #tmp where any_merge>0) OR @is_distdb = 1)
                AND (@cmptlevel<7.0)
        begin
            drop table #tmp
            return 1
        end
    else
        begin
            drop table #tmp
            return 0
        end

 
Last revision 2008RTM
See also

  sp_dbcmptlevel (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