Microsoft cursor naming convention consistency is a problem
FYI.
I was creating something like this and then i came to know that MS uses same cursor name for sp_MSforeachtable and
sp_MSforeachdb. So i was getting an error. Now i have to create another proc with different cursor name.
--Note: This is just an example program.
use master
GO
--drop proc x
create procedure x @x varchar(120)
as
begin tran
dbcc dbreindex (@x,'',70)
commit
GO
--exec master.dbo.sp_MSforeachtable "exec master.dbo.x '?'"
--drop proc y
create procedure y @x varchar(120) as
exec master.dbo.sp_MSforeachtable "exec master.dbo.x '?'"
GO
--
exec master.dbo.sp_MSforeachdb "exec master.dbo.y '?'"