将存储过程的文件导入Microsoft SQL Server中的现有数据库

时间:2016-07-08 09:08:42

标签: sql-server import

我在Microsoft SQL Server中有数据库。我还有一个文件,其中包含来自另一个数据库的存储过程。如何将此存储过程添加到我的数据库?有一个这个程序。当我试图在管理工作室中用红色下划线的数据库[dbo].[unefficient_block]中执行此过程时。我无法运行此程序,因为有错误

  

无效的对象名称' dbo.unefficient_block'。

USE [rum]
GO  
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[unefficient_block]
AS
BEGIN

DECLARE @calls int
DECLARE @msisdn nvarchar(20)
DECLARE @status int
DECLARE @warn_sms int
declare @lang int

declare cur1  CURSOR FOR 
select nds, count(*) as calls 
from rum.dbo.unefficient_calls
where nds not in (select phone from rum.dbo.huly h) 
-- and nds not in (select msisdn COLLATE SQL_Latin1_General_CP1_CI_AS from rum.dbo.unefficient_status s where status=1) 
group by nds

0 个答案:

没有答案
相关问题