Solved

Error: Could not find server 'SLDB1' in sysservers.

Posted on 2009-05-14
8
641 Views
Last Modified: 2012-06-27
I'm working on doing a point upgrade of our Syteline ERP system from 8.0.11 to 8.1. In order to test the upgrade process, I've taken a VM copy of the DB server and the Utility server. In order to have both on our live network, I've renamed them during the process and reinstalled SQL on the DB server. I did uninstall and reinstall SQL during the process.

I've restored our application databases by restoring from .bak files from a full backup.

I am now attempting to modify data within one of the tables and am coming across this error:

     No row was updated.

     The data in row 2 was not committed.
     Error Source: .Net SqlClient Data Provider.
     Error Message: Could not find server 'SLDB1' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.
     The statement has been terminated.

     Correct the errors and retry or press ESC to cancel the change(s).

SLDB1 is the name of the original server. The name for the virtual server is SLDB2.

If I do a select * from sys.servers, the name showing is SLDB2, which is what I would expect. Why would a restored database still be looking for the original server? How can I change it?

Also, using sp_addlinkedserver to add an entry for SLDB1 would defeat the purpose - the intent is to prevent modifying data on the production DB  server... the database should be looking for SLDB2.

Thanks!
0
Comment
Question by:USSC-IT
8 Comments
 
LVL 5

Expert Comment

by:Aanvik
ID: 24388267
What SQL you are using to modify your data?
0
 

Author Comment

by:USSC-IT
ID: 24389714
I'm not using code to modify the data. I've got the SQL Management Studio open and I've opened the table for editing. I've modified the contents of one row and get this error on commit.
0
 
LVL 26

Accepted Solution

by:
Chris Luttrell earned 500 total points
ID: 24552588
Use the query below to search for the value 'SLDB1' in one of the types of items checked.  Because you got the error on updating a table, it may be that there was a trigger created with a reference to the server by name for some reason.
DECLARE @searchString varchar(100);

SET @searchString = 'SLDB1'

SET @searchString = '%' + @searchString + '%'
 

SELECT sc.object_id, OBJECT_NAME(sc.object_id) AS Obj_Name, sc.definition AS Obj_Definition,

      schema_name(so.schema_id) AS Obj_Schema,

      CASE WHEN OBJECTPROPERTY(sc.object_id, 'IsProcedure') = 1 THEN 'SP'

             WHEN OBJECTPROPERTY(sc.object_id, 'IsScalarFunction') = 1 THEN 'UDF'

             WHEN OBJECTPROPERTY(sc.object_id, 'IsTableFunction') = 1 THEN 'UDF'

             WHEN OBJECTPROPERTY(sc.object_id, 'IsTrigger') = 1 THEN 'Trigger'

             WHEN OBJECTPROPERTY(sc.object_id, 'IsView') = 1 THEN 'View'

      END AS Obj_Type,

      LEN(definition) AS Obj_Length

FROM sys.sql_modules sc

INNER JOIN sys.objects so ON sc.object_id = so.object_id

WHERE

(

      OBJECTPROPERTY(sc.object_id, 'IsProcedure') = 1 

      OR

      OBJECTPROPERTY(sc.object_id, 'IsScalarFunction') = 1

      OR

      OBJECTPROPERTY(sc.object_id, 'IsTableFunction') = 1

      OR

      OBJECTPROPERTY(sc.object_id, 'IsTrigger') = 1

      OR

      OBJECTPROPERTY(sc.object_id, 'IsView') = 1

)

AND

(

sc.definition LIKE @searchString

)

ORDER BY schema_name(so.schema_id), OBJECT_NAME(sc.object_id)

Open in new window

0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:USSC-IT
ID: 24553026
CGLutrell, thanks very much for the response. I won't have access to the system until tomorrow but I will try that right away.
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 24554511
The problem might be in you made a copy of your server with SQL Server installed and uninstall didn't really clean all (maybe in Register it's something pointing to SLDB1).
0
 

Author Closing Comment

by:USSC-IT
ID: 31581625
Truly tasty bit of code. It actually helped me with an issue I'd suspected in our production 'pilot' database as well. An excellent way to search for any code fragment in SQL. Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem with SqlConnection 5 109
Need Counts 11 40
Date conversion in sql server 2012 6 25
Test a query 23 13
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now