473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stored Procedure definition not updating, causing DTS copy error

I've got a weird one here. I'm running a DTS package on SQL Server
2005. It copies a bunch of stored procedures. I renamed them on the
originating server and ran the DTS again.

The came over with the old name and code!

I deleted the DTS and built it from scratch, and the same thing
happened.
I ran SELECT * FROM sys.objects where type = 'P' on the source server
and the names were correct
I'm explicitly checking which sp to copy rather than using Copy all. I
can see the sp names
I've deleted and recreated the sp on the source server using scripts
I've checked the source server name
I've Refreshed everywhere
Nothing works

Why is up_Department_GetAllBySchool trying to be be pulled over when
it doesn't exist?
Why is up_Department_GetBySchool not being pulled over when it does
exist?

I've heard that SQL 2005 pre-SP2 has a problem where renaming an
object that has a text definition (like sprocs, functions, triggers,
views) doesn't update the definition. So if you pull that object
definition and run it into your new database, it will use the original
script, which has the original name.

I ran
sp_helptext 'up_Department_GetBySchool'
and checked the CREATE statement at the top. Sure enough, it had the
old text

I asked our NetAdmin to install SP2 on our server. Then I ran
sp_refreshsqlmodule 'up_Department_GetForSchool'
and got this error:
Invalid object name 'up_Department_GetAllForSchool'.

So even the code which was supposed to fix it, doesn't. Has anyone
else had this problem, and managed to fix it?

--John Hunter

Jun 27 '07 #1
1 2389
This is a byproduct of sp_rename, as described in the Books On Line:

"Renaming a stored procedure, view or trigger will not change the name
of the corresponding object name in the syscomments table. This may
result in problems generating a script for the object as the old name
will be inserted from the syscomments table into the CREATE statement.
For best results, do not rename these object types. Instead, drop and
re-create the object by its new name."

So sp_rename changes the object name in sysobjects, but does not
change the CREATE PROCEDURE text in syscomments, which still has the
old name.

Roy Harvey
Beacon Falls, CT

On Wed, 27 Jun 2007 01:49:57 -0000, "js******@waikato.ac.nz"
<js******@waikato.ac.nzwrote:
>I've got a weird one here. I'm running a DTS package on SQL Server
2005. It copies a bunch of stored procedures. I renamed them on the
originating server and ran the DTS again.

The came over with the old name and code!

I deleted the DTS and built it from scratch, and the same thing
happened.
I ran SELECT * FROM sys.objects where type = 'P' on the source server
and the names were correct
I'm explicitly checking which sp to copy rather than using Copy all. I
can see the sp names
I've deleted and recreated the sp on the source server using scripts
I've checked the source server name
I've Refreshed everywhere
Nothing works

Why is up_Department_GetAllBySchool trying to be be pulled over when
it doesn't exist?
Why is up_Department_GetBySchool not being pulled over when it does
exist?

I've heard that SQL 2005 pre-SP2 has a problem where renaming an
object that has a text definition (like sprocs, functions, triggers,
views) doesn't update the definition. So if you pull that object
definition and run it into your new database, it will use the original
script, which has the original name.

I ran
sp_helptext 'up_Department_GetBySchool'
and checked the CREATE statement at the top. Sure enough, it had the
old text

I asked our NetAdmin to install SP2 on our server. Then I ran
sp_refreshsqlmodule 'up_Department_GetForSchool'
and got this error:
Invalid object name 'up_Department_GetAllForSchool'.

So even the code which was supposed to fix it, doesn't. Has anyone
else had this problem, and managed to fix it?

--John Hunter
Jun 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1644
by: 8leggeddj | last post by:
Hello, I am having a problem when using access xp as a frontend for sql server 2000. I have been trying to update a number of stored procedures (Just simple adding fields etc) which results in...
4
9542
by: shyner | last post by:
Hi Everyone, I've been battling this for two days with no luck. I'm using SQL Server 2000. Here's the mystery: I've got a stored procedure that takes a single varchar parameter to determine...
5
3641
by: Timppa | last post by:
Hi, Could anyone help me with my problem ? Environment: Access 2000 and Sql Server 2000. I have a stored procedure as follows: DROP table1 SELECT alias1.field1,alias2.field2,table2.field6...
3
1646
by: Justin | last post by:
I am trying to do a simple update of a database using a stored procedure. I have get the following error when executing the code: "Procedure or function UpdateDetails has too many arguments...
4
3964
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine...
9
2446
by: Frawls | last post by:
Hi I Am am having problems with a stored Procedure that i wrote. Basically whats happening is that the Stored procedure Runs fine when i EXECUTE it in SQL Query analyzer. But when i debug...
1
2268
by: central_scrutinizer | last post by:
I have an ASP that has been working fine for several months, but it suddenly broke. I wonder if windows update has installed some security patch that is causing it. The problem is that I am...
0
3154
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
2
2981
by: E11esar | last post by:
Hello there. I am going in bit of a circle with this matter; First some background: I am trying to upload the details of a CSV file into an Oracle table. I am using a StreamReader to copy a line...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.