Home Microsoft SQL Server DigiMailing iRN Contact


  No additional text.

create procedure sys.sp_MStestbit
            @bm varbinary(128),
            @coltotest smallint
            declare @word smallint
            declare @bit  smallint
            declare @mask binary(2)
            declare @mval int
            declare @oldword binary(2)

            if @coltotest < 1 return 0

            SELECT @word = 1 + FLOOR((@coltotest -1)/16)

            SELECT @bit = (@coltotest -1) % 16

            SELECT @mval = POWER(2, @bit)
            SELECT @mask = convert( binary(2), unicode( substring( convert( nchar(2), convert( binary(4), @mval ) ), 2, 1 ) ) )

            SELECT @oldword = convert( binary(2), SUBSTRING( convert( nvarchar(64),@bm), @word, 1) )
            IF @oldword IS NULL return 0

            return  convert( smallint, @oldword ) & convert( smallint, @mask )

Last revision 2008RTM
See also

  sp_helpmergearticlecolumn (Procedure)
sp_mergearticlecolumn (Procedure)
sp_MSBitmapCount (Procedure)
sp_MSclearcolumnbit (Procedure)
sp_MSgetcolumnlist (Procedure)
sp_MSgetviewcolumnlist (Procedure)
sp_MSget_shifted_colv1 (Procedure)
sp_MSindexcolfrombin (Procedure)
sp_MSmakeorcheck_joinfilter_using_dri (Procedure)
sp_MSmakeupdateproc (Procedure)
sp_MSmerge_altertable (Procedure)
sp_MSmerge_gen_articlecolumnrowset (Procedure)
sp_repldropcolumn (Procedure)
sp_showrowreplicainfo (Procedure)


  Query a named instance
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
Zoekmachine optimalisatie
SQL Servers hidden objects
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
sIFR; de combinatie tussen HTML en Flash