Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSareallcolpkcomputed

  No additional text.


Syntax
create procedure sys.sp_MSareallcolpkcomputed
(
    @tabid int
    ,@publishertype tinyint=1        -- 1 = mssqlserver, 2 = heterogeneous
)
as
begin
    declare @isset int
                ,@isvalidcolumn tinyint
                ,@retcode int
                ,@this_col int

    select @retcode = 1
    if (@publishertype = 1)
    begin
        declare hCColid cursor local fast_forward for
            select column_id from sys.columns where object_id = @tabid order by column_id asc
    end
    else if (@publishertype = 2)
    begin
        declare hCColid cursor local fast_forward for
            select colid from IHsyscolumns where id = @tabid order by colorder asc
    end
    else
    begin
        raiserror(21402, 16, 1, '@publishertype')
        return @retcode
    end

    OPEN hCColid
    FETCH hCColid INTO @this_col
    WHILE (@@fetch_status <> -1)
    BEGIN
        exec @isset = sys.sp_MSiscolpk @tabid, @this_col, @publishertype
        if (@publishertype = 1)
            select @isvalidcolumn = case when exists (select name from sys.columns where object_id=@tabid and @this_col=column_id and is_computed !=1) then 1 else 0 end
        else
            select @isvalidcolumn = case when exists (select name from IHsyscolumns where id=@tabid and @this_col=colid ) then 1 else 0 end
        if @isset = 1 and @isvalidcolumn = 1
        BEGIN
            select @retcode = 0
            break
        END
        FETCH hCColid INTO @this_col
    END
    CLOSE hCColid
    DEALLOCATE hCColid

    return @retcode
end

 
Last revision 2008RTM
See also

  sp_MSdrop_repltran (Procedure)
sp_scriptupdproccore (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