Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MStable_has_unique_index

  No additional text.


Syntax

create procedure sys.sp_MStable_has_unique_index @tabid int
as
begin

    /*
    ** Returns id of unique index, if it exists, else 0
    */
    declare @indid int

    if (ObjectProperty(@tabid, 'IsTable') = 1)
    begin
        -- First get the primary index id.
        select @indid = i.indid from sysindexes i where
            -- get the primary key index
            (i.status & 2048) <> 0
            and i.id = @tabid

        if @indid is null
        begin
            -- Get the first unique index
            select top 1 @indid = i.indid from sysindexes i where
                (i.status & 2) <> 0
                and i.id = @tabid
                order by i.indid asc
        end
        if @indid is null select @indid = 0
    end
    else
        select @indid = 0

    return @indid
end

 
Last revision 2008RTM
See also

  sp_MSarticle_synctran_commands (Procedure)
sp_MSgettrancftsrcrow (Procedure)
sp_MSmakeconflicttable (Procedure)
sp_MSmakepeerconflicttable (Procedure)
sp_MSmaketrancftproc (Procedure)
sp_MSscript_pkvar_assignment (Procedure)
sp_MSscript_sync_del_proc (Procedure)
sp_MSscript_sync_ins_proc (Procedure)
sp_MSscript_sync_upd_proc (Procedure)
sp_MSscript_where_clause (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