Over the course of time, developers could alter table structure without realizing the implications of doing so. As the result, stored procedures have a tendency to break.
I was thinking about a way to overcome such an issue. It seems to me that the only way to find the broken stored procedures would be to generate the SQL script and restore the database in question using a different name. Then, when a procedure that wasn't valid tried to be created, it would fail. Once that script ran, a compare of the two databases could be done using a query like this:
select *
from server1.databasename1.dbo.sysobjects
where xtype='p' and name not in (select name from server2.databasename2.dbo.sysobjects where xtype='p' )
The invalid stored procedures would be listed.
Now, let me throw a monkey wrench in the mix. I am in an environment that requires all stored procedures to be stored as encrypted procedures. That means that when you generate the SQL script, all it says is that the stored procedures are encrypted and can't be scripted.
Anyone have any ideas about how to handle finding broken stored procedures in a development environment?
-Chris
I was thinking about a way to overcome such an issue. It seems to me that the only way to find the broken stored procedures would be to generate the SQL script and restore the database in question using a different name. Then, when a procedure that wasn't valid tried to be created, it would fail. Once that script ran, a compare of the two databases could be done using a query like this:
select *
from server1.databasename1.dbo.sysobjects
where xtype='p' and name not in (select name from server2.databasename2.dbo.sysobjects where xtype='p' )
The invalid stored procedures would be listed.
Now, let me throw a monkey wrench in the mix. I am in an environment that requires all stored procedures to be stored as encrypted procedures. That means that when you generate the SQL script, all it says is that the stored procedures are encrypted and can't be scripted.
Anyone have any ideas about how to handle finding broken stored procedures in a development environment?
-Chris