当时也不怎么脑袋有坑选了个数据库的选修课,那位大哥帮忙看一下这个怎么翻译啊,什么意思~拜托解释下~~~~
IF LOWER(@property collate SQL_Latin1_General_CP1_CS_AS) ='description'
    BEGIN
        UPDATE dbo.MSpublications SET description = @value
            WHERE   publisher_id = @publisher_id AND
                    publisher_db = @publisher_db AND
                    publication = @publication
        IF @@ERROR <> 0 
            goto UNDO
END    ELSE if LOWER(@property collate SQL_Latin1_General_CP1_CS_AS) IN ('retention')
    BEGIN
     select @retention_value = convert(int, @value)
select @publication_type = publication_type
from dbo.MSpublications
WHERE   publisher_id = @publisher_id AND
                    publisher_db = @publisher_db AND
                    publication = @publication
        UPDATE dbo.MSpublications set retention=@retention_value 
        WHERE   publisher_id = @publisher_id AND
                    publisher_db = @publisher_db AND
                    publication = @publication
        if @@ERROR<>0
         goto UNDO
END    ELSE if LOWER(@property collate SQL_Latin1_General_CP1_CS_AS) IN ('retention_period_unit')
    BEGIN
     select @retention_period_unit = convert(tinyint, @value)
UPDATE dbo.MSpublications set retention_period_unit=@retention_period_unit 
        WHERE   publisher_id = @publisher_id AND
                    publisher_db = @publisher_db AND
                    publication = @publication
        if @@ERROR<>0
         goto UNDO
    END

解决方案 »

  1.   

    这段代码,看似跟replication有关.
      

  2.   

    --简单说就是判断更新IF LOWER(@property COLLATE SQL_Latin1_General_CP1_CS_AS) = 'description'        --判断@property转换排序规则为cp1_cs_as后是否为description
        BEGIN
            UPDATE  dbo.MSpublications             --更新发行表相关描述信息
            SET     description = @value
            WHERE   publisher_id = @publisher_id
                    AND publisher_db = @publisher_db
                    AND publication = @publication
            IF @@ERROR <> 0 
                GOTO UNDO
        ENDELSE 
        IF LOWER(@property COLLATE SQL_Latin1_General_CP1_CS_AS) IN ( 'retention' )   --同上判断
            BEGIN
                SELECT  @retention_value = CONVERT(INT, @value)  
                
                SELECT  @publication_type = publication_type   --获取发布类型
                FROM    dbo.MSpublications
                WHERE   publisher_id = @publisher_id
                        AND publisher_db = @publisher_db
                        AND publication = @publication
                        
                        
                UPDATE  dbo.MSpublications                --更新发布表
                SET     retention = @retention_value
                WHERE   publisher_id = @publisher_id
                        AND publisher_db = @publisher_db
                        AND publication = @publication
                IF @@ERROR <> 0 
                    GOTO UNDO
            END    ELSE 
            IF LOWER(@property COLLATE SQL_Latin1_General_CP1_CS_AS) IN ('retention_period_unit' )   --同上
                BEGIN
                    SELECT  @retention_period_unit = CONVERT(TINYINT, @value)
                    
                    UPDATE  dbo.MSpublications
                    SET     retention_period_unit = @retention_period_unit
                    WHERE   publisher_id = @publisher_id
                            AND publisher_db = @publisher_db
                            AND publication = @publication
                    IF @@ERROR <> 0 
                        GOTO UNDO
                END