I have a local SQL 2000 database. My Winform app suddenly died when trying to all a stored proc that has not changed. Here's teh error message:
Server: Msg 7404, Level 16, State 2, Procedure RecordCurrentUser2, Line 45 The server could not load DCOM.
Then, I noticed that when I try to alter the SP using Query Analyzer, I would get the same error when I tried to execute the ALTER command. I trimmed down the stored procedure, leaving the core code that causes the error when executed:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER PROCEDURE dbo.RecordCurrentUser2
(
@xmlUser varchar(8000)
)
AS
BEGIN
DECLARE @Now datetime
DECLARE @ChangedRecordCount int
--Normally this is commented out, but for testing, we'll hard code a param value:
SET @xmlUser = '<User>
<User>
<EmailId>[email protected]</EmailId>
<LastName>Chad</LastName>
<FirstName>Smith</FirstName>
<Initials />
<DomainName>NA</DomainName>
<Account>SMITH</Account>
<TelephoneNumber>179-1458</TelephoneNumber>
<PeoplesoftId>031X45</PeoplesoftId>
<Department>Order to Collect BI Reporting</Department>
<StreetAddress>58 Hill Road</StreetAddress>
<PostalCode>06333</PostalCode>
<Location>MAIN</Location>
<State>AK</State>
<Country>United States</Country>
</User>
</User>'
DECLARE @DocHandle int
SET @Now = GETUTCDATE()
-- Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @DocHandle OUTPUT, @xmlUser
--Put the contents of the XML string into a temp table
SELECT
EmailId
,LastName
,FirstName
,Initials As Initials
,DomainName
,Account
,TelephoneNumber
,PeoplesoftId
,Department
,StreetAddress
,PostalCode
,Location
,State
,Country
,OtherTelephone
,NonUnisysDomainName
,NonUnisysAccount
INTO
#TempItems
FROM
OPENXML (@DocHandle, '/User/User', 2)
WITH
(
EmailId nvarchar(80)
,LastName nvarchar(50)
,FirstName nvarchar(50)
,Initials nvarchar(30)
,DomainName nvarchar(10)
,Account nvarchar(10)
,TelephoneNumber nvarchar(50)
,PeoplesoftId nvarchar(50)
,Department nvarchar(50)
,StreetAddress nvarchar(50)
,PostalCode nvarchar(50)
,Location nvarchar(80)
,State char(2)
,Country nvarchar(30)
,OtherTelephone nvarchar(50)
,NonUnisysDomainName nvarchar(10)
,NonUnisysAccount nvarchar(10)
)
END
The following service are running in my machine, although they may not be relevant: Distributed Transaction Coordinator (note-running a local db) COM++
I didn't intentional install anything recently, although I recall seeing an MS patch get automatically applied by company policy, not sure what it was or how to find out.
How can I resolve this error?