Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



dbo.sp_sysutility_ucp_recreate_synonym_internal

  No additional text.


Syntax
CREATE PROCEDURE [dbo].[sp_sysutility_ucp_recreate_synonym_internal]
   @synonym_name sysname, @database_name sysname, @schema_name sysname, @object_name sysname
WITH EXECUTE AS CALLER
AS
BEGIN
   DECLARE @null_column nvarchar(100)
   SET @null_column = NULL
   IF (@synonym_name IS NULL OR @synonym_name = N'')
        SET @null_column = '@synonym_name'
   ELSE IF (@object_name IS NULL OR @object_name = N'')
        SET @null_column = '@object_name'
   IF @null_column IS NOT NULL
   BEGIN
        RAISERROR(14043, -1, -1, @null_column, 'sp_sysutility_ucp_recreate_synonym')
        RETURN(1)
   END
   IF  EXISTS (SELECT name FROM sys.objects WHERE object_id = OBJECT_ID(@synonym_name) )
   BEGIN
      RAISERROR('Dropping @synonym_name synonym', 0, 1)  WITH NOWAIT;
      DECLARE @drop_statement nvarchar(600)
      SET @drop_statement = N'DROP SYNONYM [dbo].' + QUOTENAME(@synonym_name)
      RAISERROR ('Executing: %s', 0, 1, @drop_statement);
      EXEC  sp_executesql @drop_statement
   END
   DECLARE @full_object_name nvarchar(776) = QUOTENAME(@database_name) + '.' + QUOTENAME(@schema_name) + '.' + QUOTENAME(@object_name)
   DECLARE @create_statement nvarchar(1060)
   SET @create_statement = N'CREATE SYNONYM [dbo].' + QUOTENAME(@synonym_name) + ' FOR ' + @full_object_name
   RAISERROR ('Executing: %s', 0, 1, @create_statement);
   EXEC  sp_executesql @create_statement
END
 
Last revision
See also

  sp_sysutility_ucp_initialize_mdw (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