原貼出處CSDN,具體文章記不清了,在原來的基礎上修改了一點:if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_createjob]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure [dbo].[p_createjob]GOcreate proc p_createjob@jobname varchar(100),
現象:有一台測試環境的機器中,執行sp_helpdb,提示下面的錯誤資訊。不能向表 'tempdb.dbo.#spdbdesc___________________________________________________________________________________________________________00010002498F'的'owner'列插入空值。Description: This indicates a problem with your SQL
PRB: You receive error 3724 when you drop a non-replicated objecthttp://support.microsoft.com/?id=326352SYMPTOMSWhen you try to drop or to rename an object (a table, a view, or a stored procedure) that is not replicated, you may receive an error
SET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS ON GOif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spFindTextInColumns]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure
--建立轉換函式create function f_FormatNumber( @n numeric(18,6) )returns varchar(30)asbegin declare @t varchar(30) set @t=cast(@n as varchar(30)) while right(@t,1)='0' set @t=left(@t,len(@t)-1) declare @i int set @i=charindex('.',@t)
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_calc]') and xtype in (N'FN', N'IF', N'TF'))drop function [dbo].[f_calc]GO/*--計算運算式的函數計算給定算術運算式的值此方法由VB版 hhjjhjhj(大頭) 提供的VB處理常式程式上改造而來--鄒建 2004.07(引用請註明此資訊)--*//*--調用樣本select dbo.
USE masterGOIF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[spForceRestoreDB]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)DROP PROCEDURE [dbo].[spForceRestoreDB]GOSET QUOTED_IDENTIFIER OFF SET ANSI_NULLS ON GO/*
/* --在觸發器中自訂日誌 --vivianfdlpw 2005.10.24 引用請保留此資訊*/create trigger tron 表for updateas--記錄資訊declare @o int ,@f int ,@t int ,@ret int ,@info varchar(1000) --要記錄的資訊 ,@path varchar(255) --記錄檔路徑select