Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSreplcheck_name

  No additional text.


Syntax

create procedure sys.sp_MSreplcheck_name
    @name            		sysname,
    @parametername	sysname, -- Used to generate more actionable error message.
    @procname			sysname,
    @raise_error    		bit = 1
AS
    declare @index    int

    Set nocount on

    -- Name cannot be NULL or empty ("")
    -- Blank identifiers (" ") are allowed
    IF (@name is null OR datalength(@name) = 0)
    begin
        if @raise_error = 1
            raiserror (14043,16,-1, @parametername, @procname)
        return (1)
    end

    -- Check for proscribed characters

    declare @length int
    select @length = datalength( @name ) / 2
    select @index = 1
    while @index < @length
    begin
        if( 0 = unicode( substring( @name, @index, 1 ) ) )
        begin
            if @raise_error = 1
                raiserror(15006,16,-1,@name)
            return (1)
        end

        select @index = @index + 1
    end

    --check for other proscribed characters

    select @index = charindex( N'%', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N'*', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N'[', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N']', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N'|', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N':', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N'"', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N'?', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    /*
    ** Fix 52855 - allow single quote
    **
    select @index = charindex(N'''', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    */
    select @index = charindex(N'\', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N'/', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N'<', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end
    select @index = charindex(N'>', @name)
    if (@index <> 0)
    begin
        if @raise_error = 1
            raiserror(15006,16,-1,@name)
        return (1)
    end

    -- return success

    return (0)

 
Last revision 2008RTM
See also

  sp_addmergearticle (Procedure)
sp_addmergepublication (Procedure)
sp_add_agent_profile (Procedure)
sp_IHgetPublicationInfo (Procedure)
sp_MSadd_publication (Procedure)
sp_MSrepl_addarticle (Procedure)
sp_MSrepl_addpublication (Procedure)
sp_MSrepl_addpublication_snapshot (Procedure)
sp_MSrepl_changepublication_snapshot (Procedure)
sp_MSrepl_publicationsnapshotjobcontrol (Procedure)
sp_scriptsubconflicttable (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