Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RPC

Status
Not open for further replies.

seekwall

Programmer
May 14, 2001
41
0
0
GB
I am trying to attach a database to one server from another with this code...

declare @prm_allocserver varchar(20)
set @prm_allocserver = '<servername>'
declare @prm_drive char(1)
set @prm_drive = 'D'
declare @sql varchar(1000)

select 'Attaching <Databasename> to Allocated Server'
set @sql = char(013) + @prm_allocserver + '.master..sp_attach_db ' + char(039) + '<Databasename>' + char(039) + ', ' + char(013)
+ '@filename1 = N' + char(039) + @prm_drive + ':\<Databasename>\<Databasename>_Data.mdf' + char(039) + ',' + char(013)
+ '@filename2 = N' + char(039) + @prm_drive + ':\<Databasename>\<Databasename>_Log.ldf' + char(039)

Both servers run SQL Server 7

When I run the code I get the following error message...

Server: Msg 7411, Level 16, State 1, Line 1
Server '<servername>' is not configured for RPC.

To combat the problem, I ran the following code on the 'allocated server'

execute sp_serveroption 'servername','rpc','true'
go
execute sp_serveroption 'servername','rpc out','true'
go

When I run the original sql, I still get the same error message

Can anyone help me ?
 
Server: Msg 7411, Level 16, State 1, Line 1
Server '<servername>' is not configured for RPC.

You might need your sysadmin to do this, but on the server having the problem, go to START > CONTROL PANEL > ADMINISTRATIVE TOOLS and open SERVICES. Scroll down the list and see if you can find the Remote Procedure Call (RPC) service. Does it exist? Is it started?

(By the way, that path to SERVICES is for Win2K, for WinNT you might need to follow a different path.)

-SQLBill
 
Thanks Bill.

I stopped and restarted the service and it works fine now
 
If you keep having the problem, you may want to see if you can put something in your code to restart RPC.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top